Skip to content

GavickPro/GK-Taxonomy-Images

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

GK-Taxonomy-Images

Simple plugin for easy adding featured images in WordPress Tag/Category pages

Usage on your theme

We suggest to use the following code in the category.php file in order to display the image on the category page:

<?php 

if(function_exists('gk_taxonomy_image')) {
    $category = get_the_category();
    $img = gk_taxonomy_image($category[0]->term_id, 'category-image', '', false);

    if($img) {
        echo $img;
    }
}

?>

The gk_taxonomy_image function retrieves up to 4 parameters:

  • term_id
  • CSS class names (can be separated by space)
  • other attributes (width, height etc.)
  • echo - decides if the function will echo the image directly or will return it as a string.

About

Simple plugin for easy adding featured images in WordPress Tag/Category pages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published