Categories Images

Categories Images is a WordPress plugin which allow you to add an image for each category (or term), it is so easy to user. This plugin will create a new text input that will had the image url of the category, in both forms when adding a new category or edit an existing one, you can put a url for the image or upload it bu click on the text input.

Installation:

  1. Open your wordpress admin panel, then plugins menu > Add New and search for ‘Categories Images’.
  2. Click to install.
  3. Once installed, activate and it is functional.

Or you can install in manual:

  1. Download the plugin from WordPress Plugins.
  2. Extract it, then upload the extracted folder ‘categories-images’ to ‘/wp-content/plugins/’.
  3. Go to your wordpress plugins menu, then activate it.
 
You are done! And the plugin is ready to use.
Usage and documentation:
after installing and activating the plugin, just use the following code:
Default usage:
use the following code in category or taxonomy template,put it in any <img /> tag :
<?php if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url(); ?>

or simply:

<?php if (function_exists('z_taxonomy_image')) z_taxonomy_image(); ?>
Difference between the two methods are as following:
  • z_taxonomy_image_url() return the taxonomy image url as a string so you can put it in any <img /> tag with support of the following parameters:
    • $term_id, the category or taxonomy ID, default NULL
    • $size, default ‘full’
    • $return_placeholder, default FALSE
  • z_taxonomy_image() return category or taxonomy image as html with support of the following parameters:
    • $term_id, the category or taxonomy ID, default NULL
    • $size, image size (check here for more about WordPress image resizing), default ‘full’
    • $attr, array of some html img tag attributes like: (default NULL) please check parameter $attr here
      • alt, default is the image file name
      • class, default is ‘attachment-$size’
      • height, default none
      • width, default none
      • title, default none
    • $echo, to enable or disable printing out the html, default TRUE.
Using inside a loop:
use the following code in anywhere at your wordpress theme, here is an example:
If  looping for categories:
<ul>
<?php foreach (get_categories() as $cat) : ?>
<li>
<img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
<a href="<?php echo get_category_link($cat->term_id); ?>"><?php echo $cat->cat_name; ?></a>
</li>
<?php endforeach; ?>
</ul>

or

<ul>
<?php foreach (get_categories() as $cat) : ?>
<li>
<?php z_taxonomy_image($cat->term_id); ?>
<a href="<?php echo get_category_link($cat->term_id); ?>"><?php echo $cat->cat_name; ?></a>
</li>
<?php endforeach; ?>
</ul>

If looping for taxonomies:

<ul>
<?php foreach (get_terms('your_taxonomy') as $cat) : ?>
<li>
<img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
<a href="<?php echo get_term_link($cat->slug, 'your_taxonomy'); ?>"><?php echo $cat->name; ?></a>
</li>
<?php endforeach; ?>
</ul>

or

<ul>
<?php foreach (get_terms('your_taxonomy') as $cat) : ?>
<li>
<?php z_taxonomy_image($cat->term_id); ?>
<a href="<?php echo get_term_link($cat->slug, 'your_taxonomy'); ?>"><?php echo $cat->name; ?></a>
</li>
<?php endforeach; ?>
</ul>

If your post had more than one category and you want to loop for all post categories use the following example:

<ul>
<?php foreach (get_the_category() as $cat) : ?>
<li>
<img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
<a href="<?php echo get_category_link($cat->term_id); ?>"><?php echo $cat->cat_name; ?></a>
</li>
<?php endforeach; ?>
</ul>

or

<ul>
<?php foreach (get_the_category() as $cat) : ?>
<li>
<?php z_taxonomy_image($cat->term_id); ?>
<a href="<?php echo get_category_link($cat->term_id); ?>"><?php echo $cat->cat_name; ?></a>
</li>
<?php endforeach; ?>
</ul>

And if your post had more than one taxonomy and you want to loop for all post taxonomies use the following example:

<ul>
<?php foreach (get_the_terms(get_the_ID(), 'your_taxonomy') as $cat) : ?>
<li>
<img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
<a href="<?php echo get_term_link($cat->term_id, 'your_taxonomy'); ?>"><?php echo $cat->name; ?></a>
</li>
<?php endforeach; ?>
</ul>

or

<ul>
<?php foreach (get_the_terms(get_the_ID(), 'your_taxonomy') as $cat) : ?>
<li>
<?php z_taxonomy_image($cat->term_id); ?>
<a href="<?php echo get_term_link($cat->term_id, 'your_taxonomy'); ?>"><?php echo $cat->name; ?></a>
</li>
<?php endforeach; ?>
</ul>

Using resizing feature:

To resize category image simply add the size as a second parameter, for example:
if in category or taxonomy template:

<img src="<?php echo z_taxonomy_image_url(NULL, 'thumbnail'); ?>" />

or

<?php z_taxonomy_image(NULL, 'thumbnail'); ?>

or if inside a loop:

<ul>
<?php foreach (get_the_terms(get_the_ID(), 'your_taxonomy') as $cat) : ?>
<li>
<img src="<?php echo z_taxonomy_image_url($cat->term_id, 'medium'); ?>" />
<a href="<?php echo get_term_link($cat->term_id, 'your_taxonomy'); ?>"><?php echo $cat->name; ?></a>
</li>
<?php endforeach; ?>
</ul>

you can choose to resize from these (thumbnail, medium, large, full) or any custom sizes, also you can use it as array with dimensions for example:

<img src="<?php echo z_taxonomy_image_url(NULL, array(300, 250)); ?>" />

or

<?php z_taxonomy_image(NULL, array(300, 250)); ?>

Please check WordPress codex here for more information about resizing.

To display image with support for alt, class, width and height, you can do as this example:

<?php
$attr = array(
'class' => 'category_image',
'alt' => 'image alt',
'height' => 200,
'width' => 300,
'title' => 'category title',
);
z_taxonomy_image(NULL, 'full', $attr); ?>

if there were any bugs or you faced any problems please reply to this post, if I had more time I will update this plugin and add more features.

update 26-07-2012: I had noticed that there is some people talking about my plugin, here is a link to the post 🙂

http://wpshock.com/wordpress-category-images-taxonomy-images-plugin/

another one here also:

http://www.williamsgraphics.co.uk/featured-images-categories-wordpress/

Update 06-10-2012: Finally I got some time to test the plugin in WordPress MU and now I confirm that the plugin works so fine whether you choose to activate the plugin by blog or using network activation from your network control panel

Update 25-01-2013: A great update had been made to this plugin, and hope you liked it, Thank so much to Joe Tse http://tkjune.com

Update 14-06-2013: I had updated the plugin with some new features like using WordPress new media uploader and new sub menu (Categories Images) in Settings menu allowing you to exclude any taxonomies from the plugin, this for fixing and avoiding any conflicts with another plugins like WooCommerce plugin, hope you all like the last update.

Update 20-12-2013: I had updated the plugin with new features like resizing images please check the docs above for more help about using this new feature, and also adding support for Spanish language. Thanks so much to Maria Ramos and to Rahil Wazir for their help.

Update 2.5 28-03-2015: A nice update which introduce a new function to display category or taxonomy image directly with support for size and alt and more attributes, please check the documentation above. Also adding support for Ukrainian language, thanks so much to Michael Yunat.

565 thoughts on “Categories Images

  1. How do you use it exactly? An example would be nice.

    If I want to loop through a list of categories and display the image, name, and link for each?

    1. Sorry for the late update I was busy the past few days, please re-check the post again I had updated it.

      1. yar maza agya apka plugin ka wish you good luck taxonomy term custom post type ka like this is best i have seen

    2. Dear friend,

      thanks for the plugin but I have a question. When i edit the category, I upload a photo from media library, everything is ok, but then its not shown in the website..any suggestions?

      1. I´m having the same problem. Please, could you help me? I’m not good enough with programming stuff

      2. I’m having the exact same problem. Please someone explain if they’ve found out a solution for this. I’m really overwhelmed and unsure about editing code.

    3. How do I show the image of the category next to (before or after) the category name on the Categories list on the homepage of my website.

      Thank you, Muhammad, for your cooperation,

  2. Hi, I have a doubt: I uploaded the image for a category, however, after that, I make click on “Insert in post” and nothing is added to “Image” field on the category edition screen. How do I have to upload an image within admin area?

    Thanks.

    1. I can’t guess what is the error in your case, but any way you can copy the uploaded image link and paste it into the image field, click on image field, copy the uploaded image link from your media library, close the upload box or press escape on the keyboard, then paste the copied link into image field.

      1. Hi, I’m having this problem as well. When I click on the image field, it does not allow for pasting anything and simply launches the media uploader, and when I choose an image or a url or upload an image from my computer, then hit the button that says use the image, the box closes but nothing appears in the image field. There is no way I can get an image URL to appear in that field. I’m on the latest version of WordPress. Any ideas?

        1. may be something wrong with your javascript, most the users had reported it works great with the last ver of wordpress, but anyway you can copy the image url manually and put it in image field, it will work fine

          1. Hi!
            I had the same problem just in case in media uploader I had the “link URL” field empty (before insert into post/category).

            If it’s not empty (the img url is visible in Link URL field), the plugin works perfectly.

            Thanks for tha awesome plugin!!

  3. Hi! great plugin!
    I’m trying to use your function to get the category image in single.php, I mean, I want to get the category image uploaded also inside a single post… but I can’t get it!

    Also in archive.php I’m using

    <img src="" alt="" />

    "other thing"


    It’s works great, but seems like the conditional it’snt working… when I haven’t image uploaded it’s showing a broken link image…

    Could you help me? Thanks a lot!!!

    1. ups! I wrote the code tag wrong… sorry…
      I wanted to say that the conditional is not working… always try to show an image…
      “if (function_exists(…”

      1. I’ve just found a solution, only valid if you are using only one category for post, like my case.

        <img src="term_id); ?>" />

    2. Thanks so much, hope your problem had been solved, if you want to list categories with images anywhere, you can use the loop method in documentation, and this will be useful if the post had more than 1 category.

      1. Hello Zahlan. I have installed the plugin and added an image to the Category “Agricultural Engineering” on / in the Business Directory plugin. http://everythingagricultural.com/business-direcotry/

        As you can view the thumb nail image 80×80 is not visible. I tested your plugin again on a newly added Category but the image is still not visible.

        I have seen the comment about the “loop” but I do not know where I should place the code and I am worried about updates breaking the code after I input the images.

  4. Thanks for plugin 🙂
    Can i aks u something? I have a problem: some of my posts have different categories (ex: cat1, cat2, cat3) but if i put your code into my template:

    appears only one icon, and not the icons of cat1, cat2, cat3
    how can i do?
    Thanks
    Alex

    1. Thanks, have you tried the loop method in the documentation above ? I think it will solve your problem. I had updated the post check the 3rd example.

  5. Thanks for the awesome plugin!

    I have a quick question:

    I am currently using the “looping for categories” code you provided (with a few minor changes). But I was wondering how would you go about excluding a category.

    Here’s a link to the test site that I’m working on. Note the little square above the True(ish) thumbnail, that’s the category I want to hide
    http://www.test.campallaccess.com/site1/category/messages/

    Thanks.

    1. Thanks, you can easily pass any arguments you want to get_categories() function, for example (as in your case) you want to exclude one or more categories:
      $args = array( ‘exclude’ => ‘1,2’ );
      as you noticed I had excluded category id 1 and category id 2, and then pass this array to get_categories() function like this:
      get_categories($args)
      btw, and you can use more arguments as explained in the wordpress codex here: http://codex.wordpress.org/Function_Reference/get_categories

      hope this would help 🙂

      1. For whatever reason I kept getting php errors… But it’s ok. I figured out another way that should actually work out better for my current setup.

        Thanks anyway!

  6. Is there some easier tutorial how to do it? I don’t know much of programing. I got lots of categories at my site.

    Thanks in advance for your help.

    1. Ok no problem, just tell me exactly what do you want to display and I will try to help 🙂

      1. As I said before I got lots of categories and I would like to have one icon per each superior category. Please check out my site and let me know if that’s possible to do it.

        Thank you very much.

    2. Ok simply after downloading and activating the plugin, just use one of the 4 examples above like this way:

      – use the 1st if you want to get the category icon url in (category/taxonomy) template.
      – use the 2nd or 3rd examples if you want to get a list of all (categories/taxonomies) in any template.
      – use the 4th example in single template in case your post have more than one category and you want to list them.
      hope this would help.

  7. Do you have any plans to add a size selector using image size such as the thumbnail, or custom image sizes that are added?

    1. The main idea of this plugin was to make it so simple, but I like your idea, I will think of it 🙂
      Thanks so much

      1. Thanks. I was thinking on it last night and I think the easiest would be to expand the function that pulls the image like this…
        z_taxonomy_image_url($cat->term_id, 'thumbnail')
        As it is now, I’m hard coding the image size of the icon and using 3 different sizes for different displays.

      2. It`s great idae.
        Please – consider adding options to works with custom added (via add_image_size( ‘test’, 80, 80, true ); )

    2. currently you can change the category/taxonomy image size before inserting it to the image field while adding or editing any category/taxnonomy (I mean before pressing insert into post button). I had made it this way to let you even use outside link of the image, not just hosted images on your website.
      But ok, I will think of changing this to make it more flexible about getting the image url.
      Thanks for sharing your thoughts 🙂

  8. Hiya, could you show me how I can show just the child categories of a particular category. I basically have a main category lets say “Drinks” and under them have “Wines” “Fizzy” “Beer” etc and I just want to show the categories and images with those child categories.

    Thanks 🙂

    1. check this comment and replace $args = array( ‘exclude’ => ’1,2′ ); with this $args = array( ‘child_of’ => 1 ); as 1 is your parent category id (drinks in your case).

      1. Hi Zahlan, thanks for the reply but I’m having trouble. All the categories are still showing this is the code I am using could you take a look…

        9 );

        foreach (get_categories($args) as $cat) : ?>

        <img src="term_id); ?>" />
        <a href="term_id); ?>">cat_name; ?>

        1. For some reason the code didn’t format (I did wrap in tags. Anyway I have put it on pastebin if you can have a look for me.

          http://pastebin.com/YFqgdxUi

  9. Hi, Thanks for the great plugin.

    I have installed it and added a few images for my custom taxonomy.

    Displaying the images and name of taxonomy entry is a challenge. Please help me.

    Tha code in my page template is as follows.


    term_id);
    echo get_term_link($cat->slug, 'store');
    echo $cat->name;
    }

    get_footer();

    ?>

    Thank you

    1. Thanks Bahaa 🙂
      Simply use the last example in the documentation and it will work fine if you use the default wordpress loop.
      In case you are using another loop (like using get_posts and foreach) pass the post_id to the function get_the_category and it will work fine.

      Hope this would help 🙂

  10. Hi Zahlan,

    thanks for this plugin! now I have a little problem. I have two taxonomies that use some terms with the same name. now when I call z_taxonomy_image_url() with $term->term_id I get the same image for both terms called “hogan” which are in two different taxonomies. I tried changing the slug of one term but it still uses the last defined image on either of the terms.

    any help greatly appreciated!

    1. Thanks so much.
      I think using a different slugs for each one will solve this problem, but let me check again to make sure there are no bugs here, wait for my reply.

  11. Can the image field be displayed within a view, using the Views plugin? I’m not able to select the image field as a custom field, nor does the PHP code work. Any advice would help.

    Thanks for the plugin!

    1. Thanks, wordpress categories does not have custom fields, only posts or pages that supports custom fields if that what you asked for, I’m using wordpress options to save each category or taxonomy image in my plugin.

    1. Thanks, I’m not using shortcodes in my plugin yet, put thanks so much, I will update the plugin soon 🙂

  12. Sorry if I am brain dead here. I have the plug in working but on the single page of the post the category image does not show… help!

  13. I’ve tried and tried to made this work, but I can’t call the image in my template. Please let me know how I can make it show in this:

    PAGE)): ?>
    ITEMS; ?>

    CATEGORY); ?>

    <div class="dt-onethird">
    name; ?>

     

    $pagination,
    'tax_query' => array(
    array(
    'taxonomy' => 'portfolio',
    'field' => 'id',
    'terms' => $portfolio_id
    )
    ),
    'paged' => $paged
    );
    ?>

    1. no problem I will try to help you, I just need the code as you can see it is not completed here in the comment, so if you don’t mind upload it to Dropbox or any other website like that.

  14. Hi Zahlan,

    Thanks for making the best categories images plugin available, I’ve got it working great with my standard posts, however I’m having trouble using it with my Custom Post Type. I want to list all the categories for my type ‘product’ with their respective pictures, and I can’t seem to do so with any of the examples above. I’m a bit of a WordPress noob and not used to get_categories, which doesn’t allow me to use post_type to name my custom post type – could you explain/post the code for how to do this?

    Many thanks

    1. Thanks so much, yes exactly you can’t use get_categories while you need categories of a custom post, so you can use the 3rd example in the documentation and don’t forget to change ‘your_taxonomy’ with the taxonomy name that you register with your custom post.

  15. This plugin looks great. One question: How can I load the image in the header.php (outside loop) for the category “page”, I think it is called category archive page. Can you provide a php example ? Thanks!

    1. you can use is_category() function in the header to check if you are in category template or not, like this example:

      ?>

  16. Hi Zahlan!

    Thanks for the PlugIn! It works great!

    I just wonder if there’s a way of putting category description to that.

    Best regards,
    /Jennie

    1. Thanks so mcuh, getting the category description is not related to the plugin at all 🙂 but I can help you, just tell me where to put the description I mean which template ??

      1. Hi Zahlan,

        I would really appreciate your help. It’s for the index.php template and I am making a horizontal list of categories with title, image and description underneath.

        Here’s the code:

        cat_name; ?>

        <a href="term_id); ?>”><img src="term_id); ?>” />

        Unfortunatly it doesn’t work. I wont show the description.

        Thanks!
        Best regards,
        /Jennie

        1. Hi again,

          Seems as if most of the code was cut of. Here’s a new try:

          cat_name; ?>

          <a href="term_id); ?>”><img src="term_id); ?>” />

    2. ok I had seen your code, simply change “echo category_description();” to “echo $cat->description;”
      may this fix your problem.

  17. Hey Mr Zahlan,

    first things first: I love the plug-in. Awesome job.

    But I have a problem. By now, I have a category for “featured” posts to put certain posts in a special position in the blog. i don’t want these categories to appear as category images so I just gave them a 1x1px transparent image which, of course, kills my layout (in a way).

    Is there a way to exclude certain categories from showing up as images?
    Not giving them an image at all is not an option since some browsers still show the (X) “image not found”-thingy.

    Thanks for your help!
    Joe

    1. Simply you can assign the result to a variable and check if this variable is empty or not, check this code:
      term_id);
      if (!empty($cat_image)) :
      ?>
      // your category image

  18. hello,

    This plugin is great! but i only have a question.

    How i can show only the taxonomy images of the post?
    namely I have for example: taxonomy -> Social Networks. and i would like show in the entry or profile the social network(taxonomy images) of this person.
    Expample:
    Name: John Brad
    Social Network: facebook(image) | Twitter(image)
    Descrption: xxxxxxxxxxxxxxxxxxxx

    Ok, so i have more social networks: digg, twenty, etc… in the taxonomies, but I just want to show the of that profile

    Sorry for my english!

      1. I created a new custom theme, and i have it in my localhost, not is online…Only i need know if i can use other system without foreach for that only show the taxonomies for the post, no all of taxonomies. I use this:

        <a href="slug, ‘socialnetworks’); ?>”>
        <img src="term_id); ?>” />

        But this print me all the taxonomies son and i only want show the profile taxonomies.

        Understand? sorry I dont write and speak good english

      1. ok I’m sorry I think I got you wrong, ok let us simply use the 2nd example in for loop method in the documentation, all you have to do is change get_terms(‘your_taxonomy’) to get_terms(‘your_taxonomy’, array(‘parent’ => 0))
        This code means that you want to loop for parent taxonomies only (looping for the top level taxonomies), I’m sure this will fix your problem.

        1. Hi… I’m using this in my project on taxonomy-productcategory.php so that I can show the subcategories of the parent terms. I have got it to work by hardcoding foreach (get_terms('productcategory', array('parent' => 6)) as $cat) : and it will show me all subcategories, but I need to code it so that it picks up what category page it’s on dynamically. Any help would be greatly appreciated!! Thanks

    1. Thanks for enhancing my plugin 🙂 but let me explain something, the reason I use the full image url to not force the user to host the image at his blog, he can use any url from anywhere, also I’m using it to let him easily can use any re-sizing image tools like timthumb.
      I had also check the code, it will only work in case you have a taxonomy called ‘package_cat’ because you had disabled my foreach 🙂 so by default the plugin after your modifications won’t work, I think you should test it on a new wordpress installation. Thanks again 🙂

  19. What code shall I use if I have multiple categories? Actually this is not a post category. It’s a listing category. I tried the code above but it did not work.

      1. I have the same problem, I want to show in my page a list of categories with images. If you can help me please. I think your plugin is awesome 🙂

    1. Great, then use the last example above, put it anywhere at your single.php tempalte.
      And if you where using taxonomies (not categories) replace the function get_the_category(); with the function get_the_terms( $id, $taxonomy ); where $id is the post_id and $taxonomy is your taxonomy. I will update the documentation and add another example for that, Thanks.

  20. Hi, how to add external link for this image? Example: in my template i put this: <a href="term_id); ?>"><img src="" alt="" />
    But on <a href="term_id); ?>"> link to category, I want this category image link to external link. Example: category image “Best Buy” link’s to “www.bestbuy.com”. How?

    1. simply in the ‘href’ attribute just don’t use the php code to get the category link and put your link

      1. I’m using this code:

        <img src="”/>

        to pull in the images for the different category and I would like all the images to have different external links. How would I do that?

  21. Hey Zahlan, I was wandering if was possible to use a resize command when calling the category image, this way I only need 1 higher quality image which can then be resized to make the smaller thumbnail versions as well. If this isn’t possible how can I have 2 image fields per category.
    Thanks in advance.

    1. Hey, Thanks for using my plugin.
      The current ver of the plugin does not support image resizing so I recommend to you to use TimThumb plugin, you can upload a high quality image and use the Timthumb plugin easily to resize it while displaying it 🙂

  22. Hi – Nicely done plugin. I was using it fine and then I changed the folder structure so that all images are stored in the same folder (not organized by date) and this seems to have broken it. Unfortunately I am have to use that folder structure. Is there a way around this? Cheers,

    1. Unfortunately if you change the upload folder structure won’t display images because the image full path is stored as the image filed value, so you have to maintain the upload folder structure or you have to change all categories images to the new structure

  23. dear zahlan!
    i think I like your plugin, but don´t know now how to use it properly. I want to replace the two categories in the left sidebar with one image each. but i don´t know where to put that code exactly to achieve that.

    it would be great if you would just have a quick look at my site!

    thank you very much!
    Steffi

    1. Thanks, you can do that by passing some $args to the function get_categories($args) and you can find more about how to do that in the WordPress codex here

  24. Dear Zahlan,
    Yes, I have tried the one you told me, but it gave me an error.
    I was putting it in the functions.php at the end, but am not sure where to put exactly. I´m not familiar with php coding, have read a bit about it but its very hard to learn within some days…. 😉

    I appreciate for your help very much!
    Steffi

    1. It’s Ok, no problem, 1st you shouldn’t put my example at your functions.php you should put it inside your theme, for example if you want to list categories in sidebar or something like that, use the 1st loop example and put it into sidebar.php or if you want to list categories in home put the code into index.php

      try this and tell me if you got what you need

  25. Dear Zahlan!
    I would like to show you my sidebar.php
    I´m using a 3 column layout but want to show the images in the woocommerce sidebar, maybe thats useful information for you. here´s my code:

    ‘monthly’ ) ); ?>


    <img src="term_id); ?>” />
    <a href="term_id); ?>”>cat_name; ?>

    now, where I was putting it, it´s not doing anything.
    I feel already bad to post again, but would love to use your plugin!

    So thankful for your help!

    Greetings
    Steffi

  26. Hi Zahlan,

    First of all. Thanks for the simple but great plugin. I’ve got just one advice. If you’d change line 29 in categories-images.php form “wp_enqueue_script(‘thickbox’);” to “wp_enqueue_script(‘thickbox’); wp_enqueue_script(‘media-upload’);” the “Choose Image” popup will resize itself to fit the screen.

    Greets.
    Milan

    1. Thanks so much for your advice, but the current version of the plugin already do what you said 🙂
      I didn’t notice any problems!

  27. Dear Zahlan!
    Any news about my code? Still want to use your plugin! I hope you can read the code!

    thank you very much for your help!
    greetings
    Steffi

    1. Really sorry for my late reply.
      I had checked your code, you are using the sidebar.php and my example should work normally, please tell me exactly what happened when you put my code ?

  28. Hi Zahlan,

    Is there a way to set a default image for any category that does not have an image assigned? I am creating a related posts widget and need to have an “image not available” type image display.

    Thanks for your work on this plugin,
    Amy

  29. dear Zahlan!
    actually nothing is happening when I put your code. I can see the image-uploader in the categories and have already put an image. but in the frontend on the page itself the image is not shown.
    what am I doing wrong?

    greetings
    Steffi

    1. try to move the example code into the category template, and make sure that the categories you are want to display chosen in some posts

  30. hi i have installed the Categories Images plugin and used the code

    term_id); ?>
    <a href="term_id); ?>”>cat_name; ?>

    its displaying the category name and link but the image is not display its leaving blank plz help me

    1. make sure that you have added an image to this category from the admin panel 1st and the value of the image field has the url of this image.

    1. Thanks so much, simply replace wp_list_categories(‘depth=1’) with get_categories(array(‘parent’ => 0))
      btw the wordpress function wp_list_categories() already output(echo) data so you can’t use it inside a loop.

    1. Thanks for reporting this bug, I already fixed it, you will get the update from wordpress soon, Thanks.

  31. hello zahlan,
    first thumbs up for the plugin.
    recently i updated your plugin to 2.2 and unfortunately, the plugin function is unable to retrieve the image url for display. could you check this issue?
    anyways,
    thanks

    1. Thanks so much, yes some users already reported this bug and it had been fixed this morning and you should be noticed about a new update of the plugin.

      The current working ver of the plugin in the date of this this comment is 2.2.3

  32. Is there a way to add this to the twentytwelve “Posted in…” function: function twentytwelve_entry_meta()

    Thanks for your help

  33. Awesome plugin! Is there a way to get rid of the bullets from the list?

    Second question, what would be the best way to reconfigure the list into a grid?

  34. wordpress 3.5.1, theme, Twenty Twelve
    I have usd this code, in category.php in H1

    <img src="” alt=”” />

    Plugin work fantastic with categories.
    I have used the same code in theme/tag.php but the image not display.

    Can you help to me?
    Regards

      1. 给分类添加图片 用调用代码在分类页面可以实现调用,可是给标签添加完图片之后用调用代码在tag.php页面调用之后 无法显示啊,求助!!

  35. Hello Zahlan,

    Love the plugin but I can’t get the images to display. I created an image for each category, uploaded and placed the url in each category. The thumbnail in the categories page is populated but the post widgets (home page)do not display the category image. I wanted the category image to be displayed whenever a single post did not have a featured image. What am I missing?

    http://shgww.com

    Jeffrey

  36. Hello,

    First of all I gotta say what an amazing and wonderful plugin you developed here. Thank you so much! However the issue I’ve run into now is that it seems taxonomy images aren’t working for IE6 users. I know that most people are no longer using it, however my client still has a significant number of those users and he can’t drop them.

    Is there any possibility of making some small modifications to the code so that IE6 users can also view the images? IE7 works fine it seems.

    Thank You and a great plugin once again!

      1. Hi Zahlan,

        I tried again on IE7 and actually it doesn’t seem to work either. IE8 works but not 6 or 7. When I view it on IE7 for a second or two the images are displayed, however after that nothing, they disappear. Is there anyway to get this to work?

        Thanks

          1. I disabled all CSS and unnecessary HTML elements and the problem still persists. The images no matter what won’t show up. This is really problematic in that the client really wants IE7 users to be able to view the site. Is there no other way for you to try and test this?

            I’m willing to make a donation or pay per hour if you could resolve this issue, just send me your paypal details.

            Thanks so much!

  37. Hello everybody. Thank you Zahlan for such a useful plugin! I use this categories-images plugin on all of my WordPress projects.

    Just wanted to share this note with people using this plugin and the WooCommerce plugin together. Because WooCommerce uses the same button id names “update_image_button” and “remove_image_button”, adding product category images to WooCommerce categories breaks, and neither plugin works for these product categories (taxonomy).

    The simple fix for me was to rename these 2 buttons in your plugin to something else, like “update_img_button” and “remove_img_button” so that the jQuery code works and does not conflict with WooCommerce Product Categories. Of course I could update the WooCommerce plugin, but since this plugin is so much lighter and easier to manage, I chose to update this plugin instead.

    Perhaps in the future, this plugin could rename these 2 button ids/names so that it works with WooCommerce automatically. Of course this is up to the plugin author, Zahlan.

    Thanks again! — Marty McGee

    1. Since my plugin in newer than WooCommerce plugin, so I had updated mine to avoid conflicting. Thanks Marty McGee.

      1. This is a great plugin. It is really simple to use and lightweight.

        I was also having some issues with Woocommerce since it has it’s own built in taxonomy image control for product_cats. I found a way to turn off the category image for product cats only by removing the actions and filters for category images for that taxonomy only. This is what I used in my theme functions:

        // remove the other category image plugin by Zahlan when in the admin for woocommerce
        add_action(‘admin_init’, ‘undo_z_init’, 999);
        function undo_z_init() {
        $z_taxonomies = array(‘product_cat’,’product_class’); // add any taxonomies you want to omit for category_images plugin
        if (is_array($z_taxonomies)) {
        foreach ($z_taxonomies as $z_taxonomy ) {
        remove_action($z_taxonomy.’_add_form_fields’, ‘z_add_texonomy_field’);
        remove_action($z_taxonomy.’_edit_form_fields’, ‘z_edit_texonomy_field’);
        remove_filter( ‘manage_edit-‘ . $z_taxonomy . ‘_columns’, ‘z_taxonomy_columns’ );
        remove_filter( ‘manage_’ . $z_taxonomy . ‘_custom_column’, ‘z_taxonomy_column’, 10, 3 );
        }
        }
        }

  38. Hi! i want make a query of a image of a speficic category…

    for make a list of categories with his thumnnail…

    what can i do?

    Regards, Patricio.

  39. Hi, great plugin, could you please post an example using a custom taxonomy, I cannot seem to get it to work with the WordPress custom taxonomy call.

    Many thanks,

  40. Hello, Zahlan. Firstly, I must thank you for this plugin of yours. It was truly what I was looking for! I successfully posted a list with the images, titles and descriptions on a page so my visitors have an idea of what I blog about.

    Unfortunately, there is something I seem unable to do and I could use your help – please note this is not directly related to your plugin, meaning its functioning, so you are free to neglect me any help on the following: I would like to have an image of the proper category appearing next to the post title. Saturday, when I started my blog, everything seemed fine> I used your plugin on both the index and single files and styled it a bit and the category image appeared successfully. However, today when I was doing the list for all categories, I made a new testing post just to see how it worked: the list is working fine but as you should expect, now the icons for the two categories I have are appearing on both my posts.

    Is there any chance to make ONLY the correct category image appear within a post? I know that it is possible to show the category images on posts but I am perfectly ignorant as to do it with your plugin, or even if that-s ‘workable’.

    The address in question is http://blog.wizard-wheezes.org, not the main website listed on this comment form.

    Thank you again for sharing this plugin with us and thank you also for your much awaited reply (or of any other user currently reading this message).

    1. Yes, you can do that by using the ‘order’ parameter, for example:
      ‘desc’)); ?>

      Please check the WordPress Codex for more parameter and examples.

      Thanks.

  41. Hi Zahlan,
    Grt work buddy, but I need more of ur help :P, the thing is, i want to show the sub categories of the parent category i clicked, any help regarding this

    Thanks in advance

    1. Thanks so much.

      Please check this comment and for sure you will have to use the parameter ‘child_of’ for the current category id.

  42. I can not show the image on the home, see the expression

    $return_html .=”;
    (here like to have a condition if the posting has not show the thumbnail category)
    $return_html .= (!empty($val[‘image’])) ? ”.$val[‘image’].” : ”;
    $return_html .= (!empty($val[‘title’])) ? ‘‘.$val[‘title’].’‘ : ”;
    $return_html .=”;

    1. You are using the plugin function in a custom loop, so all you have to do is to pass the category_id to the function, for example: z_taxonomy_image_url($cat_id) as $cat_id is the category_id of the post in your loop.

  43. Hello I just installed the plugin and was happy it worked I was able to upload my pic to category (I want to have a feature image at top – I only have one category for posts for my site with no subcategories) the thumb shows in the edit mode but there is no picture in the actual category. I then added your fist code at the top here and I now get just the text path to the image and its not a link just the text. NOTE: I have the gonzo theme and for categories it has a line divider with a label title saying “your browsing x category” I did not want this so I deleted the code in the category template successfully here is the top portion of the file as well I will mark where I deleted code and what that code was. Also please let me know exactly what to input and where as I do not know this stuff well thanks!

    ADDED YOUR CODE HERE AS WELL AS ON DIFFERENT LINES SAME OUTCOME

    REMOVED THIS “name);?>” TO HERE

    <?php // Determine whether to use a preset blog style or echo content (with shortcodes)

    $category_blog_style = get_tax_meta($category_ID,'omc_blog_style');

    1. All you have to do is to put this path into a tag img, if you notice in the second example above I put the return of z_taxonomy_image_url() into an img tag

  44. I love this plugin, its so easy to use. However, I need a little help.

    Im creating two custom post types that do virtually the same thing, list all taxonomies (categories) in a custom post type, by thumbnail – with a link to the single custom post.

    Has anyone figured this out for two custom post types with two sets of taxonomies?

    Got it working for the first, but not for the second, it just reverts to index.php

    1. nevermind! works perfectly on two separate custom post type taxonomies. The error is in my post type, when I set my permalinks to default, looks beautiful.

  45. Hi Zahlan,

    great useful plugin!

    I think I’ve found a bug. When you use Editor role you can’t upload images, the path is not copied in the Upload text box after clicking Insert Into Post on the Media popup. Using a custom taxonomy and post type.

    With an Admin role it works as expected. Made my client Admin for now, but not ideal.

    Gr,

    Martijn

  46. Hi Zahlan,

    thank you for your plugin! I have some problems integrating it into my code (I’m not a php crack) – so maybe you can have a look:

    I’m trying to loop through all child-taxonomies (works fine) and then displaying the taxonomy image (witch isn’t working yet)…

    Heres my code:

    http://pastebin.com/fZruEaDc

    The last call works fine – I insert it just for testing.

    Maybe you can have a look, why this code isn’t working.

    Greets Jens.

    1. Sry, two seconds after posting I’ve found the error on my own!

      Thank you so much for this plugin!

  47. Hi, I have used the plugin and it worked great and is simple to use.
    The only thing i have been searching to do but didnt found anything.

    I want to get the category image by defining the custom height or width of the image, like the way we use get_the_post_thumbnail.

    So is there a way to get the image by defining the custom width ?

    Please update me asap.

    Thanks

    1. Thanks so much, unfortunately this plugin does not support that. However, you can use a resizing plugin like Timthumb to get what you want.

  48. Hey there Zahlan,

    is there any way to output all images from all categories in a list?
    If so, is there a way to do this outside the loop, say for example on the front page?

    Thanks in advance!

  49. Hello ! I’ve installed the pluggin in Classipress and used the first code given in this page.
    The issue is that I have the url of the image displayed and not the image itself.
    I’m not at all used to do things with php. Can uou help please ?
    Thanks !

    1. 🙂 ok
      Simply create the image tag and put the 1st example in the src attribute like this:
      < img scr="” />

      Hope I helped

  50. Hello, it’s me again.
    The pluggin works so good that I was thinking to use it in my site first page, where the categories are listed (to have like categories thumbnails).
    The code done before isn’t working. What I have actually is :

    <div id="directory" class="directory “>

    Where is the trick ?
    Thanks for your help.

    Greg

  51. I have to tags: club and player name…

    i want to show only the image for the club tag?
    how can i do this?

    he show nothing when i try this–

    <img src="” class=”head-emblem” />

  52. Hi,

    Thanks for your plugin.

    I am new in word press.i have installed the plug in and i have copy the code and paste to page editor.but i can’t get category image and category Name.

    My code is:

    <a href="term_id); ?>”>cat_name; ?>
    <a href="term_id); ?>”>
    <img alt="term_id); ?>” src=”term_id); ?>” width=”225″ height=”300″ />

    What i am wrong please advice.

    Thanks,
    Venkat.

  53. Hi, I’m trying to incorporate your plugin with this base of code :
    $link .= ‘

    Sorry but i’m very bad in php, how can i replace/integrate your image category ?

    Thank you very much for your help !
    Regards,
    Thibault

  54. Hello,

    I am building a woocommerce site. I would like to use a category image like a banner on top of all the products.

    I am uploading images to the product categories but the images dont show up on the site. What should I do??

    I have attached the temporary URL of the site. I would like a different image under each category on the main product menu.

  55. Hello,

    I Translate Your Plugin To Persian Language and ADD .po File in languages Folder but it does not show

    What should be done?

    thanks.

  56. Hello,
    To begin with, sorry for the mistakes, I’m French !

    In order to not assign a picture to each tag, I modified the code with an “if / else” php option. But it doesn’t work in the else’s case.
    The code is below. For you, what’s the problem ?
    Thank you.

    <?php
    if (function_exists('z_taxonomy_image_url')) {
    echo "term_id).”>”;
    } else {
    echo ”;
    }
    ?>

  57. What if I have categories and if click on cat then display sub-cat. This can be done with wp_list_categories, but then images cannot
    be displayed.
    P.S. Nice job

  58. Dear all,

    I am using categories to filter blogs.
    I have ulploaded the plugin and associated each category with a picture.
    The purpose was to have this picture associated in the headbanner for each articles associated with this category.
    What else do I need to do in order for this to work?
    Many thanks!
    Luc

  59. Hi,

    I installed this plugin to change the header-image with the associated category. This really works fine if the category is selected and all all related posts are listed in the content. But when I select a single post from the list, the category image disapears. Even if a post image is uploaded to the selected post it won’t be shown anymore (this works if the plugin is deactivated).
    Any possibility to fix it?

    regards Michael

  60. I am having an issue with categories that do not have an image specified displaying the first product title of the sub-category as an alt attribute.

    I am using Woocommerce. I am not sure what I am doing wrong or what the workaround might be. I am using the code for a single category, and when an image is specified it displays correctly.

    Any help would be appreciated!

  61. Nice plugin, but when I view a single post that is in a sub-category it’s not showing the image I have set for that sub-category. Should this work or am I missing something?

  62. Hi Zahlan,

    I’m newbie and I’ve install your plugin please guide to me, how to display only one category image in my homepage, I’ve paste your code:

    <img src="” />

  63. This is a really great plugin. Thanks so much for taking the time to create and maintain it. I do have one question, which I hope you have an answer for: How would I display the taxonomy image of a tag outside of the loop?

    For example, in my tag archive template, the top section needs to display the current tag’s image and description, just like it would in the category template. The loop doesn’t begin until after the tag image and description. Here’s what I have in my category archive template:


    <img src="" />

    How would I make this work for tags? I’ve tried all of the examples above, but it doesn’t seem to work without using it within the loop.

    Thanks for any help that you can offer.

      1. Man, I gotta tell you. The plugin is great, bu I’m facing the same problem: use featured images in tags. If you found a solution, would you share with me? Thanks a lot.

  64. Hi Zahlan,

    This plugin is exactly what I am looking for.

    I am trying to get the plugin to work with the code below in the single page template.
    I am wanting to use is for an additional features taxonomy. (feature_item)

    But I am not sure what I am doing wrong. Any assistance would be great.

    <img src="" alt="" />

     

  65. Awesome plugin and I love it, i am new in wordpress coding. I use this code

    <img src="term_id); ?>” />
    <a href="term_id); ?>”>cat_name; ?>

    After using this code, category show all the list,when i click in category it does work. I want to make like this: when i click in category,it need to show all the post from the category list. Is this possible?

  66. Hi there, great job on the plugin by the way, its awesome. I have a problem. I’m using wp_list_categories to display my posts and need to somehow include the category images with this. Is there any way to integrate your function in with wp_list_categories?
    I have tried using other ways to display my posts to make it easier to use your plugin but I really do have to do it this way. I can get your plugin to work but just not with wp_list_categories. Any help would be greatly appreciated. Thanks again, Jamie.

    1. Hi Jamie,

      Did you figure this out? I’m having the same issue – trying to get the category images to appear while using wp_list_categories. Thanks 🙂

  67. Hi this is nice plugin… thanks.
    but i have a issue with this.
    in my theme showing main catgory image for the subcategory also. why??

  68. A useful plugin. Thank you.

    Like others, I had the need for using different image sizes with the plugin, so I have made some modifications to your original code to store the attachment id (as is done with post thumbnails) instead.

    This then allows you to use inbuilt WordPress functions to get the image at the required size.

    Let me if you’d like me to send you my changes.

  69. Hi there,
    I have a custom built Library for my podcast and your plugin looked like the perfect addition.
    However, I can’t get the images to show?
    http://crafting-a-life.com/craftlit/?page_id=243

    I couldn’t use the whole code you put above as most of it was already used in the custom code, but I did find the “right” place to put the img src tag… and it’s showing placeholder images but not the real images.

    The images ARE loaded, however, when I look at the Categories listing in the dashboard.

    Thank you so much for the plugin and your help!
    Heather at CraftLit podcast

  70. Hi, I want to display Name of Parent Taxonomy & Below it thumbnails of Sub-taxonomies. I am not getting how to do it. Can you please help me?

  71. I am using wordpress 3.8. The code for “If looping for categories:” works fine but the other codes are not working. Is there any compatibility issue with 3.8 (may be by usage of get_terms, get_the_category, get_the_terms in later codes)?

  72. This comment will help others just like the trick helped me.

    I was struggling with wp_list_categories(), i wanted to show child category image with a list of child category names, so this plugin helped me with to set category image for all category and sub category but i was unable to show image in the front end. I solved this by editing the file category-template.php in wp-includes which is a core file and engine to wp_list_categories.

    I changed

    function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
    extract($args);

    $cat_name = esc_attr( $category->name );
    $cat_name = apply_filters( ‘list_cats’, $cat_name, $category );
    $link =
    ‘term_id) .'” /> –<<<—- added the plugin line ——–

    description) )
    $link .= ‘title=”‘ . esc_attr( sprintf(__( ‘View all posts filed under %s’ ), $cat_name) ) . ‘”‘;
    else
    $link .= ‘title=”‘ . esc_attr( strip_tags( apply_filters( ‘category_description’, $category->description, $category ) ) ) . ‘”‘;
    $link .= ‘>’;
    $link .= $cat_name . ‘
    ‘;

    .
    .
    .
    .

    So i got:

    2 wheel

    honda

    yamaha

    According to the plugin documentation and it worked for me… Thanks a lot 😀

  73. I can’t understand how to use where I put the piece of code that you gave.
    Can you please elaborate how to use with image?
    How can I get the image source through category??

  74. Hello.
    I like to display only one Category icon/image in the post as a link and not all the available categories.

    Can you please post a sample code for this. Thank you.

    1. Forgot to report back, that I managed to figure this out on my own and also added “Title” for the image:

      <a href="term_id); ?>"> <img style="border: none 0px !important;" Title="cat_name; ?>" src="term_id); ?>" />

      Zahlan, thank you for the plugin that actually works 🙂

      Cheers!

  75. Hello,

    I would like to display a default image if a category image hasn’t been uploaded. I tried the following but it didn’t work. I would be grateful for your help. Thanks.

    <?php
    if (function_exists('z_taxonomy_image_url')) {
    echo '’;
    } else {
    echo ”;
    }
    ?>

  76. Hey there! I know this is kinda off topic but I was wondering if you knew where I could get
    a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one?
    Thanks a lot!

  77. Hi ,
    I have a problem with image height i am using
    <img src="” />
    height always show up less than the value i entered

  78. This code/plugin rocks! Super helpful. I’m wondering if it’s possible to set the Featured image as a background image for Category Names?

  79. I am using following code to display the images but the images do not contain ALT tag/text, although I have updated the image alt text in Media->Library, Need help how to add.

    ‘name’,
    ‘parent’ => ‘0’,
    ‘order’ => ‘ASC’,
    ‘exclude’ => ’54’,
    )
    ?>

    <a href="term_id); ?>”><img src="term_id); ?>” />
    <a href="term_id); ?>”>cat_name; ?>

    1. 'name',
      'parent' => '0',
      'order' => 'ASC',
      'exclude' => '54',
      )
      ?>

      <a href="term_id); ?>"><img alt="term_id" src="term_id); ?>" />
      <a href="term_id); ?>">cat_name; ?>

  80. thanks for this.

    but i need to read the comments to get this:
    term_id);
    if (!empty($cat_image)) :
    ?>
    // your category image

    \m/

  81. Hi, and thanks for this great plugin!
    But, I have one question…how to use this plugin with wp_list_categories function? I’m using this function to list categories hierarchically. I want insert image inside the ( li ) tag, before link (not in link).
    My idea is in category page display only subcategories of current categry and it’s subcategories in the same ( li ) tag (hierarchically)…that’s why I need the wp_list_categories function.
    But I dont know how to customize wp_list_categories output, to insert in ( li ) tags a image.
    I hope someone will be able to help me or at least give an indication of which direction to dig.

    1. at the moment I using this code to display only subcategories of current category in category page…

      ‘id’,
      ‘child_of’ => $current_term->term_id,
      ‘taxonomy’ => $current_term->taxonomy,
      ‘hide_empty’ => 0,
      ‘hierarchical’ => true,
      ‘depth’ => 2,
      ‘title_li’ => ”
      )); ?>

  82. Hi Thanks for the great plugin.

    I am trying to create a pagination for the categories on homepage. how can i do this?

    <img src="term_id, ‘medium’); ?>” />
    <a href="term_id); ?>”>cat_name; ?>

    Felix

  83. Hi, again!

    I have one question. How to check if the image is set? i want display image tag only when is set a image for this category.

  84. Hey Zahlin, firs tof all awesome plugin, it works perfectly.

    I have a quick question though, is it possible to have the actual image that is uploaded have a URL attached to it? Like, if I click on that image that is being put on the page on the front end, can it have a link included with using the plugin?

    Thanks in advance!
    Mike

  85. hello

    Like your plugin, but i have one questian..
    I use this on:

    <img src="term_id); ?>" />
    <a href="slug, 'car-list'); ?>">name; ?>

    And now it only show the one that have one in the count.
    But how can i do if i whant to show allt the taxonomy.

      1. I cant show the code.
        Is the code that are: If looping for taxonomies:

        try again:

        <img src="term_id); ?>" />
        <a href="slug, 'car-list'); ?>">name; ?>

  86. great work really, I was looking for such function since a long time.

    Any help how I can center the banner (image ) in the body area of a page with side bar?
    Now the image is center all over the total width of the page, I just to display in center the body page ignoring the width of the side bar.

    Thanks for any help
    regards

  87. Hi Zahlan!

    Great plugin, thank you!

    One question – I’d like to display “new.gif” image next to categories where a new post been added to in the nav menu. Can you give me any hint, how to achieve this if I use your plugin as a base?

    Thanks in advance!
    Estela

  88. Hello, I’m using your plugin and i can’t seem to display an image on my tag.php page, it displays fine on the category.php, any idead?

    Thank You In Advance!

  89. Hello, thank you for this great plugin.

    After some digging i found out that it works even better with the plugin Post Tags and Categories for Pages

    I wanted to have different pictures like small headers in my category title section on each page. So i used Categories for Pages to add your code with a small adjustment <img src="term_id); ?>" /> So that each page has his own picture. I really liked that my idea worked out. Im not much of a programmer though each day im getting better more and more.

    Thank you so much, keep up the good work ^^

  90. Hello Sir,
    How can I get Image Url of Category Image that is stored in wp-option table?
    Pls, Give me Guidance about this.
    Thank You.

  91. Hi,

    In index.php, how to echo <img src="” /> by catgory id

    as:
    <a href="” title=””>”(img by category 9) />

    Thanks

  92. Hi,
    In index.php, how to echo by catgory id
    <a href="" title=""><img src="term_id); ?>" (img by category_id=9) />

    http://pastebin.com/75WjL8hx

  93. hello Zahlan, thx for the great plugin, i have a problem to show parent category only with the category thumbs that linked to the child category, can you help me.. thx again

  94. Hello Zahlan. My name is Hardeep. From last two times when i updated the plugin in my site. The image icons and image paths are stopped to show in Category Quick Edit Mode. After a long time check i found that you are using
    ” $(“a.editinline”).live(“click”, function(){ ”
    Now i changed it to
    $(“#the-list”).on(“click”, “a.editinline”, function(){
    and it is working well now. Please correct this in your code so i could use your plugin next updates without any problem. Please check.

    Thanks

  95. This is really a great plugin. Thank you for your great work and see how i use it on my site (category image as logo)!

  96. I’ve implemented the code below, to show images along with the various categories/subcategories.

    $id );
    foreach (get_categories($args) as $cat) : ?>

    <a href="term_id); ?>"><img src="term_id); ?>" />
    <a href="term_id); ?>">cat_name; ?>

    I would now like to add the wordpress post loop code into an if/else statement if the user has reached the last subcategory, so that the actual posts appear. Can anyone help me with this? Many thanks.

  97. If anyone us interested, here is a simple way for adding a conditional statement for this plugin, so if there is an image uploaded show the thumbnail if not show nothing at all, that also uses your own custom thumbnail sizes:

    <img src="" alt="Your Image Alt Text">

  98. Ok, that got stripped! *PHP* stands for opening and closing PHP statements, hope that makes sense!


    *PHP* $catimage = z_taxonomy_image_url(NULL, 'Your Image Size');
    if(!empty($catimage)){ *PHP*

    *PHP* } *PHP*

  99. I have created a custom post type of “productcategory” and would like to display the parent categories. Once you click on these you can then see the sub categories.
    Here’s the code that I’ve got so far, which shows ALL of the categories http://pastebin.com/bpnFWCbE
    I’ve tried a few combinations, including this: http://pastebin.com/gLvtgiQr but I haven’t figured it out yet.
    Can anyone help me change this to only show parent categories?
    Many thanks!!

  100. How do I get the image to display on the post in the category? I’ve got the image displaying on the category page but not on the actual post.

  101. For the tag.php page you can use

    <a href="term_id, 'post_tag'); ?>"><img class="tag-img" src="term_id); ?>" />

  102. One of the most useful plugin for WordPress, it’s a must. Plus, these docs are quite explanatory for frontend developers like me. Thanx a lot for developing!

  103. Hi,Zahlan

    I want when I click on one of the categories of posts related to that category page to single.php kept and the Lamb

    Sorry, I can not speak good English

  104. Hi

    Im trying to get orderby random to work but for some reason it doesnt. any help would be appreciated.

    foreach (get_terms('actors' ,
    array(
    "orderby" => "rand",
    "number" => 5,
    'hide_empty' => 1,

    )) as $cat) :

  105. hi i want to use icon in custom post type loop how to use when i use this code term_id); ?> but all post show same icon all post

    thanks

  106. Hi I’m using

    <a href="term_id, 'gallery'); ?>" class="thumb">
    <img src="term_id, 'medium'); ?>" />

    cat_name; ?>
    Videos


    So I want to display categories of custom post type wich is called gallery but with the code above nothing shows.

  107. One thing that goes in complete favor of corporate apartments is that there are no hidden charges.
    Serviced apartments Sydney offer a home like environment.
    Chennai serviced apartments deliver outstanding amenities to the
    guests thus they are treated with special care and concern.
    You may start wondering, where to go and whom to consult for small enquiries.

  108. Obviously, it is not that simple to operate a small company because a tremendous amount
    of work is needed. The biggest advantages of outsourcing bookkeeping services for businesses is that they don’t have to worry
    about hiring trained and efficient accountants and further create
    an in-house bookkeeping department. If your Micro Small Business Australia is ever audited
    by the ATO you will need to produce these Tax
    Invoices to verify the GST Credits you have claimed back in your BAS Statements.

    Double-entry bookkeeping requires recording of each transaction twice using debits and
    credits which serves as a type of error protection system.

  109. During that time, the idea of Nintendo is very far-fetched because no one ever thought that games can be played using
    gestures of the players. Fix one of the most common problems with your Playstation PS3:.
    Since 1990, EA (FIFA) and Konami (PES) have been battling for the front seat in football games.

    Visit my webpage :: 374646 solid;border-left:1px

  110. The EPA, the US Public Health Service, and the American Dental Association (ADA), waived all testing requirements, and encouraged cities to add the radioactive concentrate into America’s
    drinking water as an “improved” form of fluoride.
    Now Avon is one of the largest companies in the industry with a turnover of more than $8 billion and upwards of 5 million distributors across the world.
    The best part is Avon representatives can make a good amount of money.

  111. Our company is passing along free samples of premium goodies.
    To become qualified to receive, simply reply to
    our comment with your address and we’ll mail it out
    within the next working day.

  112. Hi there, just became alert to your blog through Google, and
    found that it’s really informative. I’m gonna watch out for
    brussels. I will be grateful if you continue this in future.
    A lot of people will be benefited from your writing.
    Cheers!

  113. Dear Zahlan

    Thank you for the app, however since I have upgraded by PlayMag app, the option to add an image in categories has vanished. Please help me with that.
    Rachit

  114. Buying home is a very big investment, one of the most important and
    expensive purchases you are ever likely to make. When your house is properly sealed and insulated it will remain cooler in side.
    Purchasing a conservatory can provide you with so many opportunities.

  115. Hi there everybody, here every one is sharing theese familiarity, thus
    it’s pleasant tto read this website, and I used to
    pay a visit this website everyday.

  116. Hi Muhammed thanks very much for your great plugin.I’m using your plugin on all my themes but I want to as you if its possible to add a post per page number to give pagination to cateories.Do you have any Idea or tutorial link for this? Thanks again

  117. Hello Everyone,

    Im in need of some help. I am trying to use this for looping with taxonomies and everthing is working. I’m sure this is going to be easy for you guys but I can’t get my head around it. All I want to do is print the title of each taxonomy along with the link and the feature image. I just can’t seem to figure out how to do this. If you look at the code below you should get an idea of what I am trying to do.

    If looping for taxonomies:

    <img src="term_id); ?>” />
    <a href="slug, ‘your_taxonomy’); ?>”>name; ?>

    Thanks in advance,
    Niall

  118. This works great for categories, but for some reason, it doesn’t work for tags… is there something else I need to do inside my tag.php file?

  119. I was having problems implementing this on the tag.php file of the twenty twelve theme. For some reason the plugin wasn’t recognizing the tag ID, so I had to force it in. I was successfully able to implement it using this code:

    $currentTagID = get_query_var(‘tag_id’);
    $categoryImageURL = z_taxonomy_image_url($currentTagID);

    This may help other people with similar problems.

  120. Hi Zahlan – I could use some help with customizing your template code to work with a specific template loop.

    I have a Custom Post Type and Custom Taxonomy registered for it. The taxonomy is hierarchical but only so that it appears and is used/checked as a ‘category’ not as a Tag, but there are only ‘parent’ level categories – no child categories. Each custom post has a (custom) category checked, and each custom category has an image assigned to it.

    However the template page where I want to display the appropriate category image next to each Post is using a custom query that I cannot modify (it’s provided by a plugin and the query is in the plugin’s functions somewhere) and using the “foreach” just is not working. The query is done behind the scenes, but the template uses the “while have posts” loop.

    If I put the “foreach” statement above the “while”, it displays the same category image for each post (the image assigned to the first category ID) and if I put the “foreach” statement below the “while” then it displays an image next to each post that is NOT the appropriate assigned image for the category of the post, interestingly it displays the images in order of their ID number (so for the first post in the list it displays the image assigned to the first category ID, even though that is not the category ID of the post, for the second post it displays the category image assigned to the second category ID, again even though that is not the category of the Post….and so on).

    Here is my code:
    have_posts() )
    {
    ?>
    Found found_posts; ?> Results

    have_posts())
    {
    $query->the_post();
    ?>

    <img src="term_id); ?>" width="135" height="135" class="alignleft" />
    (the rest of my stuff here)

    Can you help me with this?

    1. Sorry, your comments template cut out most of my code – I will try using backticks since the standard code tag didn’t work:

      `have_posts() )
      {
      ?>
      Found found_posts; ?> Results

      have_posts())
      {
      $query->the_post();
      ?>

      <img src="term_id); ?>” width=”135″ height=”135″ class=”alignleft” />
      (the rest of my stuff here)

      `

      1. Well it appears that your comments is not letting me paste in my code to show you…..sorry…I can assure you it seems like it should work, I don’t get any syntax errors.

        BUT any help you can offer will be most appreciated.

  121. This plugin is so useful but my problem is that when I add any category details its work fine. But when I edit any category again it seems “Invalid taxonomy” massage in wordpress 4.1.1 please fix this problem.

  122. hi
    I tried to use the code to display the list of my taxonomy, but my problem, only the first taxonomy that appears, where my problem? thank you

  123. i might be doing something wrong, but i can’t get the image sizes to work. no matter what i do the images render full size.

    <img src="term_id, 'thumbnail'); ?>" />
    <a href="slug, 'inventory-type'); ?>">name; ?>

  124. I’ve been surfing on-line greater than three hours
    lately, yet I by no means found any fascinating article like yours.
    It is beautiful value sufficient for me. In my view, if all site owners and bloggers made excellent content as
    you probably did, the net can be a lot more useful than ever
    before.

  125. Countless folks keep inquiring just how to be able to hack Instagram account.
    After some time you need to enter the new password of
    the account and press for the hit key to change password.
    As far as making money is concerned, this system has 2
    parts.

  126. Thanks for the marvelous posting! I quite enjoyed reading
    it, you can be a great author.I will remember to bookmark your
    blog and will eventually come back sometime soon. I want to encourage you to ultimately continue your great posts, have
    a nice morning!

  127. Everything is very open with a very clear clarification of the issues.
    It was truly informative. Your site is extremely helpful. Many thanks for sharing!

  128. I am not sure the place you are getting your information, however good topic.

    I needs to spend some time finding out more
    or understanding more. Thanks for wonderful info I was searching for this
    info for my mission.

  129. Hello authors .
    I have this code in the file tag.php :
    <img src="term_id ); ?>” />name; ?>
    It seems that images and links have appeared twice in post_tag . The two images will appear if in an article containing two tags .
    It sounds confusing , sorry but if somehow it appears only once for each card ? Please help .

  130. Ci rien on ahurisse lapalissade ??? ho foulée, Cela rien excrétion assomme icône, un n’habitacle par hasard jumeau,
    Dans lequel l’Période confiants gageait sur du compréhension, aujourd’hui avérés
    confectionne sur des tableaux bétons pendant quelques caméras échec
    m enregistrer premier week-end analogue encarter ses dégringolades invivable
    YouTube premier lundi

  131. Is there a way to set the images so that they scale?

    For instance, I’d like to always have my images at 95px high, and then they scale correctly.

  132. Hi Dear,

    I’m using my wordpress db for a mobile application, there I need the category image. So I’m using your plugin. I know how to fetch the image in wordpress front end (website). But here the requirement is different. I need to fetch the image of the particular category from the db for writing API for the mobile application. So could you please let me know how the category and category image is connected in the DB? Its very very urgent.

  133. You is not guessing when you are trying to find quick results.
    Though, pills or fad diets that curb food cravings help in losing weight to a degree, but a majority of physicians warn that these weight-loss ways are unhealthy strategies to shedding pounds.
    We want to reveal to teens and have them understand the great things about a healthier lifestyle normally and different habits to stay fit.

  134. Love the plugin. One thing. Could you add a simple function that returned a true/false if there was an image attached to the category?

    I want to be able to do something like this:

    1. … wasn’t thinkinb about the stripped code.

      basically it’s this:

      if (z_taxonomy_hasImage() {
      display the image... }
      else { do something else... }

  135. It makes even the most common of events look like a surreal moment.
    Therefore the right ingredients can make a big difference to the way
    your wedding photographs appear at last. Detailed Oriented-A wedding photographer
    needs to focus on tiny details so that you cannot miss to capture the important moments of the wedding.

  136. Hi I am using your plugin and its pretty cool i just want to show subcategories but when i use your loop its giving me all categories with thumbnail but i want parent category just have his child and thumbnail any help would be really appreciate thanks please anyone can help

  137. We recently used this plugin to provide Category Images to our WordPress Plugin DeMomentSomTres Wine and Cheese Catalog.

    It works great.

    We did translate your plugin into catalan. You can download the translation files (.po and .mo) from website.

    It would be great to have the translated added to the main development.

    Hope it helps.

  138. Hi! Thanks for your plugin!
    One question though, When using z_taxonomy_image_alt(), the img tag outputs with width/height, src, alt. etc.

    Is it possible to just output the alt text of the image?

    Thanks

  139. looking : http://www.ajeoshi.com/wp/category-images-pagenavi.html

    category images => “pagenavi” ?

    page/1 ?
    page/2 ?
    page 3 ?
    …..

    last page/x ?

    code

    153,
    ‘numberposts’ => 10, ‘showposts’ => 10, ‘posts_per_page’ => 5, ‘parent’ => 153,

    ‘orderby’ => ‘title’, );
    $categories= get_categories($ugur);
    foreach ($categories as $category) { print ‘

    term_id ) . ‘”>
    term_id ) . ‘” />
    ‘; print ”.$category->cat_name.’

    ‘; } ?>

    12x colum = page/1 ?
    12x colum = page/2 ?

  140. I have a question! Im trying to make my categories have images on my origami site. But I don’t get how it works really. I know how to set images to the different categories, but could someone please explain what is up with the code snippets? Do I have to paste them somewhere and in that case where!?

    And this: “use the following code in category or taxonomy template,put it in any tag :”

    I cant find a category or taxonomy template ;S (ive gone to check at Apparance > Editor. But I cant find anywhere I should paste that code). And do I have to change the code? A guide for beginners would be great! Or if someone could please helpe me! that would be MUCH appreciated! 🙂

  141. Hi. Thanks for great plugin. Unfortunately after last WP update (today) the plugin stop working. Can you please fix it? Thank you 🙂

  142. Hi, I believe this is a feature request as I can’t get it to work otherwise.

    On the next release, could you insert the following 5 lines of code between lines 180 & 181? Then if the current page isn’t a straight-forward category or taxonomy archive it will instead work with the categories associated with that page. It’d be particularly useful when themeing pages depending on their category.

    } else {
    $page_object = get_queried_object();
    $page_id = get_queried_object_id();
    $categories = get_the_category($page_id);
    $term_id = $categories[0]->cat_ID;

    Many thanks 🙂

  143. superb easy way to show image link on Tag Page:

    $myid = get_queried_object()->term_id;
     if (function_exists(‘z_taxonomy_image_url’)){                              
       $value = z_taxonomy_image_url($myid, ‘full’);
          if(!empty($cc)){
             return $value ;
          } else {
             return ‘http://youblog.com/default-img.jpg’; // change this value with you image url. This value will return if function exists but not have image upload
           }
                                   
          }else{
            return ‘http://youblog.com/default-img.jpg’; // change this value with you image url. This value will return if function not exists
          }

    1. Typo, not $cc , but $value

      —————–
      correction below
      —————–

      superb easy way to show image link on Tag Page:

      $myid = get_queried_object()->term_id;
       if (function_exists(‘z_taxonomy_image_url’)){                              
         $value = z_taxonomy_image_url($myid, ‘full’);
            if(!empty($value)){
               return $value ;
            } else {
               return ‘http://youblog.com/default-img.jpg’; // change this value with you image url. This value will return if function exists but not have image upload
             }
                                     
            }else{
              return ‘http://youblog.com/default-img.jpg’; // change this value with you image url. This value will return if function not exists
            }

      1. full php

        <?php  $myid = get_queried_object()->term_id;
         if (function_exists(‘z_taxonomy_image_url’)){                              
           $value = z_taxonomy_image_url($myid, ‘full’);
              if(!empty($value)){
                 echo $value ;
              } else {
                 echo ‘http://youblog.com/default-img.jpg’; // change this value with you image url. This value will return if function exists but not have image upload
               }
                                       
              }else{
                echo ‘http://youblog.com/default-img.jpg’; // change this value with you image url. This value will return if function not exists
              } ?>

  144. I wonder if someone has figured how use this plugin to provide og:img metadata on category template page ? Would be great !
    Thanks for you hints.
    🙂

  145. Hi,
    I have main category and sub categories. So I want to display sub category images under main category. If I browse to main category page, I want to display sub category images in that page.. I tried your taxonomy wise example. But it’s not working for me. If there are any example for displaying images using term_id?

    Please help me..
    Thanks

  146. I think this is how my theme gets category images. How can I make it grab the category images from your plugin?

    name;

    // Banner Sub Title
    $banner_sub_title = $current_term->description;
    ?>

    <div class="page-head" style="background-repeat: no-repeat;background-position: center top;background-image: url('’); background-size: cover; “>

  147. parent category1 thumbnail
    parent category1 name
    subcategory 1
    subcategory 2
    subcategory 3
    subcategory 4

    parent category 2 thumbnail
    parent category 2 name
    subcategory 1
    subcategory 2
    subcategory 3
    subcategory 4

  148. Hi 🙂
    Can I use this plugin with wordpress 4.3?
    Can I Have a page with all images of categories? (as a portfolio)?
    Can I see a demo?
    Thank you very much
    Best regards
    Patrizia

  149. Hi. It’s a nice plugin. Just notice that the image is not being resized in the backend. A user uploaded a 18MB picture and it’s being loaded like so in the backend. And that’s takes a lot of time.

    So, when displaying the image in the backend you should use the “medium” size.

    Regards.

  150. Hello,

    Thank you for this great work!

    I’m using your plugin to make categories images.

    and Im using this code to display Random wp_list_categories on the sidebar ;

    term_id .’,’;
    }
    wp_list_categories(‘title_li=&hierarchical=0&hide_empty=0&show_count=1&include=’.$cats);
    ?>

    How can i add image display to this code ?

    Thank you in advance.

  151. Hi! Can I use this plugin in WooCommerce shop, for display category image by product in cart.. Please Help!)) May present php code, for include in /wordpress_template/woocommerce/cart/cart.php

    Now working only this code, and show only title category product:
    get_categories(); ?>

    But I need show in cart category image (thumbnail), by $_product

  152. Hello,
    I’ve tried everything I know and every combination and pasting ”
    on the tag.php file doesn’t display the featured image that particular tag.

    The foreach solution only lists tags and its images, which is not what I’m trying to accomplish. What I’m trying to do is to upload an image to a post_tag (e.g., website.com/tag/car) and display only the image upload to the tag “car” when someone visits the website.com/tag/car link.

    I’m just trying to implement a background image for tags (post_tag).

    Is there any way to do this?
    Thanks,

  153. Thanks for a really useful plugin, it works great once I tried a few things ;).

    For others information, if it helps: I set up a custom post function (child_cat_hub) in child functions.php to run this, and then call it from the template. It may not be the best code, but it works. See below for the basics of what I did.

    function child_cat_hub() {
    //this function calls the url generated by Taxonomy images plugin!
    //assign the course child categories you wish to display, using ID as in below
    foreach (get_categories(‘include=1,2,3,4’) as $cat) :
    echo (”);
    echo (‘term_id); // this calls the url link to the category archive page
    echo (‘”>’);
    echo $cat->cat_name; //this is the category name which prints out.
    if (function_exists(‘z_taxonomy_image_url’)); // this checks if there is an image url to call
    echo (‘term_id, ‘wp-add-image-size-name-here); //this calls the image url, and the WP add_image_size name if you add it like this
    echo (‘” />’);
    echo(‘
    ‘);
    echo (”);
    endforeach;
    } //end of child_cat_hub

    Remember you need to assign images to the categories otherwise this won’t work!

    Thanks again Zahlan for great instrcutions and code examples.

  154. Thanks for a really useful plugin, it works great once I tried a few things ;).

    For others information, if it helps: I set up a custom post function (child_cat_hub) in child functions.php to run this, and then call it from the template. It may not be the best code, but it works. See below for the basics of what I did.

    [code]
    function child_cat_hub() {
    //this function calls the url generated by Taxonomy images plugin!
    //assign the course child categories you wish to display, using ID as in below
    foreach (get_categories(‘include=1,2,3,4’) as $cat) :
    echo (‘<div class="your-div-class">’);
    echo (‘<a href="’);
    echo get_category_link($cat->term_id); // this calls the url link to the category archive page
    echo (‘">’);
    echo $cat->cat_name; //this is the category name which prints out.
    if (function_exists(‘z_taxonomy_image_url’)); // this checks if there is an image url to call
    echo (‘<img src="’);
    echo z_taxonomy_image_url($cat->term_id, ‘wp-add-image-size-name-here); //this calls the image url, and the WP add_image_size name if you add it like this
    echo (‘" />’);
    echo(‘</a>’);
    echo (‘</div>’);
    endforeach;
    } //end of child_cat_hub

    [/code]

    Remember you need to assign images to the categories otherwise this won’t work!

    Thanks again Zahlan for great instructions and code examples.

  155. Thanks for this really useful plugin, it works great.
    I’d like to ask You if is possible retrives Post count inside the Category loop. This is my code and I’d like to show how many posts are contained in each category. Thank You for the answer.

    <a href="term_id); ?>" title="Consulta la Categoria: cat_name; ?>">
    <img src="term_id); ?>" class="img-responsive" width="390px">

    Read Articles by Category
    cat_name; ?>


  156. Not all my categories are showing, not sure why. These are only the categories shown on my menu. I tried adding more categories to the menu , but that did not do anything. where do i find the taxonomy for all my categories.

    Any help is appreciated

    using code:

    <img src="term_id, NULL, array(50, 50)); ?>” height=”100px” width=”100px” />
    <a href="slug, ‘product_category’); ?>”>name; ?>

  157. Hi! I installed the plug in for Category Image. It’s allowing me to assign a picture to the category and update it; but is not showing in the web page. I’ve been reading to se if I can work it but I’m still having the same problem. When I downloaded the plug in, it said that is compatible with my template from wordpress.
    Any recommendation will be welcome…
    Thanks

  158. Is there any documentation of how to get a single post to show its parent category image? Everything else has been straight forward but I can’t work out how to do this and it seems like an obvious thing.

  159. It’s me again. I had read and read over and over again the instructions, but my Category Image does not show in the website. I installed the Category Plugin from WP. I’m not sure if I have to insert in the category or taxonomy template this: or if the installation and activation is all I need. After saying that:

    1) If installation and activation is all I need- why does my pictures are not showing in the Category? I can assign a picture, but one is assign and save when I got to the webpage is not there?

    2) If after the installation and activation I need to insert the code mention above- how do I get to the category template and where should be inserted?

    When I add the Category Image Plugin it said that is compatible with my WordPress Template which is KaciMuih.

    I really want to have a different header in my category page. Any help will be great…
    Thanks

  160. Hi there,

    I am trying to test this plugin with WP 4.5.1. I have inserted the following in the footer just before the end of the body tag:

    and it shows ‘has not function’.

    Should this simple if statement return has function. Just using twenty-sixteen theme with hardly no plugins installed.

    1. okay killed my code in comment. code is:

      if (function_exists(‘z_taxonomy_image_url’)){
      echo ‘has function’;
      } else {
      echo ‘not has function’;
      }

      Any help is greatly appreciated. thanks!

  161. OH MY GOD HOW HARD IS IT TO GET IMAGES THAT HAVE THE CATEGORY WTF NO ONE HAS TRIED THIS!?

  162. Hi,
    How can I modify it to use it with the custom taxonomies?
    I can also add a text field?
    Thank you.

  163. HI,

    Issue with WPML, I have using WPML plugin at my website,. i was not able to copy English (Default) category Image to Other Language

  164. Hello Zahlan,
    Thanks for this plugin 🙂
    It is very useful to me.

    I am using this plugin in my plugin.
    So there is any licence for how to use it ?
    May I use this plugin in my plugin ?
    Please reply.

    Thank you,
    Jigar

  165. I κnow tyis site ρresents quality dependent articles and additional data, іѕ tһere anny othewr site ᴡhich offewrs ѕuch things
    іn quality?

    Jangan lupa untuk Kunjungi halaman website Kammi buat mendapatkan Data lebih
    lengkap tentang jasa backlink .
    Terima Kasih

  166. :/ i was using category images for a long time, i was out for the weekend and went i came back the images were not showing, the others things work right the slug and the name but the images not showing at all give me an error 500, what can be happening?

    1. This is the chunk of code im using

      parent

      <img src="term_id); // URL of the Image ?>” alt=”slug, ‘ait-dir-item-category’); ?>” />
      <a href="slug, ‘ait-dir-item-category’); ?>”>name; ?>

      The image url not working at all i cannot explain what is happening.

      the webpage where the error is happpening is http://contrata.com.do/servicios/

  167. Thanks so much for creating this plug-in! How do I change the order the categories are displayed? Mine seems to be very random, not alphabetical or anything. Thank you!

  168. I use Toolset and am trying to allow users to select the name of a custom taxonomy in a dropdown, but display the icon on the page. I have 8 options and 3 icons (more than one type share a single icon). The NAME is used for searches and post creation, but I want icon to show instead. I have tried using Toolsets CONDITIONAL OUTPUT but could not seem to get that to work, so I was looking for another option. I uploaded icons to taxonomy and have tried inserting code in Content Template, functions.php, single.php, View, but am unable to get it to display. My brain has been fried long ago on this project, so specific guidance would be most helpful!

  169. Hi I tried really hard to understand what this was:

    But I really have no flipping clue. I have already downloaded the plugin, please guide me (Baby steps!) on what to do now. I Saw the little hand drawn picture icon, and used that to upload a category image, but I understand that isn’t all. Please assist! Thank you!

  170. Hi, That’s amazing ! Thanks !

    I’m using this loop to display all category images -which work like a charm:

    <img src="term_id); ?>” />
    <a href="term_id); ?>”>cat_name; ?>

    I would like to exclude the current category images . . . is there a way to achieve this ?

    1. Hi,
      I’d like to know too how to do it:)
      What I need is to show one category image (if exist) and that will link to the category page.

      Thanks!

      1. there are several WP core functions for categories like
        get_cat_ID();
        get_categories();
        $cat_obj = $wp_query->get_queried_object();
        $wp_query->query_vars[‘cat’];

        depends if you are on a category page or on a single page or/and in a loop…
        best to check the output with var_dump(…) and then see which values in the object/array matches.
        from there you can work backwards, checking the current category ID -> check of there is an image (!empty….) and retrieve the category slug from matching the ID with one of the WP cat functions
        same with the question above: check the current cat ID and is this as the reference to exclude the image

  171. BUG:
    I guess there is a bug using the ‘thumbnail’ url. When having same images for different categories it does not deliver the 150×150.jpg image (for example if 150×150 is defined for WP standard thumbnail) Instead it just shows the url to the standard image.

  172. Hi,

    I use your plugin to set the background image for the category-list page. Works like a charm.

    But I also want to set the category image as background for the “single” detail post, when clicking on “read more” at the category list. But this doen’t work out, as the “” doesn’t produce the link to the category image when used in the “single.php” header.

    In the Category Images – Settings the “post_tag” is allowed.

    So where do I make a mistake here?

    Thx for your help and best greetz, Hannes

  173. Before getting in this plugin, I would like to know if via this plugin I alsocan bring category image to front end of the site

  174. Is there any support for pulling up ONLY categories with z_taxonomy_image_url?
    I attempted to use if (function_exists(‘z_taxonomy_image_url’)), but it pulls up the categories even without the image. I also attempted to use z_taxonomy_image_url($cat->term_id) with a !==0, but it breaks or doesn’t appear to read the code at all.

  175. Nice post. I was checking continuously this weblog and I’m impressed!

    Very helpful info specially the closing section 🙂 I deal with such info a lot.

    I was seeking this particular info for a very
    long time. Thanks and good luck.

  176. I was getting a little confused by this until I realised that ‘your_taxonomy’ in the examples above refers to the type of taxonomy as found here https://codex.wordpress.org/Taxonomies

    So if you wanted to reference your post tags you would replace ‘your_taxonomy’ with ‘post_tag’.

  177. You really make it seem so easy with your presentation however I find this topic to be actually one thing
    which I feel I would never understand. It seems too complex and extremely wide for me.
    I’m taking a look forward to your next put up, I’ll attempt to get the hang of it!

  178. Hi there fantastic blog! Does running a blog similar to this
    require a large amount of work? I’ve absolutely no expertise in programming
    however I had been hoping to start my own blog in the
    near future. Anyhow, should you have any ideas or techniques
    for new blog owners please share. I know this is off subject however I just needed to ask.

    Thanks a lot!

  179. Hi,

    Thanks for your plugin and this post! Very helpful!

    I’m building a website for a magazine and uses a custom taxonomy to categorize all their issues. On one page I want to display all the front pages of their issues. The font pages shall be clickable and lead to a list of all the articles from that specific issue.

    I now have two problems:
    • When I use your code above to display all the front pages of the issues it even displays the parent categories. I don’t want to do that. Is there a way to hide them from the list?
    • I then want to display the issues in chronological order with the latest issue on the top and the oldest at the bottom, but nog WordPress sorts them in alphabetical order. Is there a way to sort the issues differently?

    Isak

  180. Hello
    i have 1500 Category..
    When Show All Category In One Page with Image its Too Long..
    I want After 20 Image its Show page number like below
    Previous 1 2 3 4 5 last

    Can any one help me for this ?

  181. Hi elzahlan!

    I found wrong query to $wpdb->posts. Please fix bug!

    Please change code in function – z_get_attachment_id_by_url($image_src) to:

    —————————————
    global $wpdb;

    $image_file = basename($image_src);
    // New and right query:
    $query = $wpdb->prepare(“SELECT post_id FROM $wpdb->postmeta
    WHERE meta_key = ‘_wp_attached_file’
    AND meta_value LIKE %s”, “%$image_file% LIMIT 1”);

    // Your old and wrong query to wp_posts:
    /*$query = $wpdb->prepare(“SELECT ID FROM $wpdb->posts WHERE guid = %s”, $image_src);*/

    $id = $wpdb->get_var($query);
    return (!empty($id)) ? $id : NULL;

    ——————————-

    1. oh sorry, the above code is not correct, right here:
      —————————————
      global $wpdb;
      $image_file = basename($image_src);
      // New and right query:
      $query = $wpdb->prepare(“SELECT post_id FROM $wpdb->postmeta
      WHERE meta_key = ‘_wp_attached_file’
      AND meta_value LIKE %s LIMIT 1”, “%$image_file%”);
      // Your old and wrong query to wp_posts:
      /*$query = $wpdb->prepare(“SELECT ID FROM $wpdb->posts WHERE guid = %s”, $image_src);*/
      $id = $wpdb->get_var($query);
      return (!empty($id)) ? $id : NULL;
      ——————————-

  182. Hi there,

    I recently migrated my site to HTTPS and the only issue I’m having is this plugin is still requesting the insecure versions of my images. How do I resolve this?

    1. Hi Mark, I’ve got the same problem. I know it’s been a year ago but if you managed to resolve it do you remember how?
      Thanks

  183. Hello! When I’m adding the description to my category the size parameter in z_taxonomy_image_url stops to work and gets default value = ‘full’. How can I fix this issue? Thanks!

  184. if the plugin generates the shortcode for the image would be better. We can use it from the front end.

  185. Is possible to exclude one or more categories from my foreach?
    The category that i want exclude is 1.
    This not work and i don’t know why.

    ‘1’ ); ?>

  186. hi i have an error when i activated this plugin

    Fatal error: Cannot redeclare z_init() (previously declared in /var/www/site.com/wp-content/plugins/plg-bebo-store/includes/thirdparty/categories-images/categories-images.php:24) in /var/www/site.com/wp-content/plugins/categories-images/categories-images.php on line 39

  187. Hi.
    How can i get only one category image to show for the relevant category (on it’s specific page)..
    eg.: Marvel category image to show only on the Marvel Category page

    Thank you

  188. Hello,

    Thank you very much for this useful extension.
    I use the Virtue theme, I had to create a child theme to overload and modify the archive.php file by adding your code: <img style = "padding-bottom: 10px;" Src = "”>
    If this can be used for other …
    Hello from Montpellier France

    A-) W

  189. Hello again,

    Small patch not need the style = “padding-bottom: 10px;”
    That’s no use! Excuse me!

    A-) W

  190. Hi, thanks for this excellent plugin! Curious if there is any way to add the category image info to the REST output?

  191. I’m extremely new to all this but I love the sleek look of having category images on your home screen. I have downloaded and installed the plugin “Categories Images” and I have uploaded images to each category but I’m so stuck on what I need to do next in order to actually make these images appear on my home page.

  192. TJ Group Marketing Corporation UK (UK TOP 20 MARKETING COMPANY)
    is announcing the launch of the new website with new services available.
    It includes Marketing, SEO, Linkbuilding services, Consulting, Social Media Services and more.

    Official Website: http://tjgroupcorp.com

  193. Excellent beat ! I would like to apprentice while
    you amend your website, how can i subscribe for a blog site?
    The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast
    offered bright clear idea

  194. Also, they have ruled the market due to their anatomical constructions of shoes that make the
    shoes anti-stress with special shock absorption system.
    Media doesn’t really know how to handle it
    and this was never more clear when we saw the Vogue Italia
    cover for June 2011. The Fashion Industry is totally focused on how people look and larger people do not figure
    on mainstream fashion’s radar.

  195. The documentation provided by your plugin is very thorough, thank you! I feel that almost any level developer should be able to pick up on what they need to know to get this working in their environment. In my case, I have multiple images attached to categories/taxonomies, and I used the documentation here to determine how to loop in the secondary image (custom field). Thank you very much!

  196. I want the head of the tag.php page add a banner , Is to output a picture
    I’m not going to loop out all the name and pictures of the tag
    Just want to make a background picture

    Not loop all

    Not loop

    How do I write code?

    Thanks

    1. Rummage Lots and lots of Course

      All say loop code

      But,No need to loop

      Output one picture How to write ?

      Look forward to your reply

  197. Hi,

    First of all, thank you so much for this plugin 🙂 It has been very helpful!

    That said, I’ve got a question for you:

    I’m trying to display the category image inside a div, but want the div to show only if the category image is set… any idea how I should go about this?

    Thanks in advance!

  198. I’m trying to change the images for each of my categories, but now when I go to “Categories Images” under Settings, all I’m seeing is “Please select the taxonomies you want to exclude it from Categories Images plugin”. I can no longer see the option to upload new images. What’s going on?

  199. I’d like to say thanks as this plugin has worked a dream for me!
    Such a simple feature addition but makes such a big difference to my blog!

    Thanks
    Rich

  200. Hi, thanks great plugin.

    I have an idea to more performance.

    on line 194.

    before:
    if(!empty($taxonomy_image_url)) {

    after:
    if(!empty($taxonomy_image_url) && $size != ‘full’) {

    reason:
    – z_get_attachment_id_by_url function spawn slow query.

  201. This does not work !
    <img src="” />

    Neither does this!

    $attr = array(
    ‘class’ => ‘category_image’,
    ‘alt’ => ‘image alt’,
    ‘height’ => 200,
    ‘width’ => 300,
    ‘title’ => ‘category title’,
    );
    z_taxonomy_image(NULL, ‘full’, $attr); ?>

    At first I thought it was a great plugin, However, totally useless without alt tags and image cropping!!

  202. Signings of Andrew Miller and Aroldis Chapman (plus the trade for Chapman) demonstrate this focus on the bullpen.
    White Sox closer David Robertson would enter in the ninth and shut down all six batters he faced on just 24 pitches to earn the win.
    There are not a lot of two-way players, that’s why the Hornets need every player to bring their unique skills in every game.

    Surprisingly, the Falcons had no one listed on Saturday’s injury report.
    Unfortunately, they gave up 17 straight points during a second half run, losing 38-31 after scoring a meaningless touchdown.

  203. Hello,
    I would like to display the image of the main category on the children pages. Could you please help me?

    br
    Jörg

  204. exclude category by id and include category by id
    please give me the solution and edit this code thanks

    <img src="term_id); ?>” />
    <a href="term_id); ?>”>cat_name; ?>

  205. Hello

    I have divided taxonomy:
    -0
    -1
    -2
    -3
    I want to display only image for 2 and 3. parent is 1.
    How to make child taxonomy image?

    I use this code:

    <a href="slug, ‘your_taxonomy’); ?>”><img src="term_id); ?>” />name; ?>

  206. Hi,
    I’d like to insert url in the input field for the image category, but by the code not by the backoffice.
    When i create/update a category by the code (wp_insert_category($args);) or wp_update_term, i don’t know how to insert data in z_taxonomy_image_url.
    Thx in advance for ur answer.
    Regards

  207. ​Hi There, I’m really hoping you can help me in any small way.

    Ii’ve been trying for 3 hours now to integrate category images, or taxonomy images into my Modern Tribe Event Calendar – and i’m really struggling.

    The most luck I’ve had in not breaking anything is as follows:

    ‘.get_the_title().’

    This should be returning an image – but it’s returning nothing except my alt text.

    Is there any easier way that you can think of for me to add a custom category image to my events??

    Thanks so much for any insight you can give me

  208. Hi There, does anyone know how to get a parent cat by its id with its image, title and description on a page
    also showing its child (sub) categories with their image, title and descriptions. If anyone can help id appreciate it as I’m really stuck. Thanks Steve

  209. Hi There,

    The plugin is great and has been working well, however, I am having a problem with the plugin lately. I have managed to upload category header images and all of a sudden the new categories I have created don’t seem to be displaying the images allocated to them.

    Can anyone assist in solving this issue?

    Thanks

  210. Hi, Im using the loop code below but only want to display subcategories on the page (not the current category or any sibling categories, just subcategories). When I use the code below it is showing all categories within our setup. Any ideas on what to modify please to only show subcategories?

    e.g. with the categorisation below, if you view the page for category A you should only see links to subcat A1 and A2.

    -category A
    — subcat A1
    — subcat A2
    -category B
    — subcat B1
    — subcat B2

    Many thanks

    <img src="term_id); ?>” />
    <a href="term_id); ?>”>cat_name; ?>

  211. Hi!! Thanks for this great plugin… It have been working greatly but now I’m having some difficulties… On the products tags it’s showing me the uploaded image + the text… How do I make just the image visible without the text?
    Any suggestion?
    Thanks a lot!

  212. Hi,
    My category.php looks like this:

    Please help me where to put the code to display the picture in the categorie?
    I can see it in the upload but it’s not op de page at the category.

    Please help, I need this to make my website to work

  213. Thank you for this helpful plugin. I am not a programmer and if I may ask for a minor help please?

    The plugin works with main Category archive pages (without inserting any additional code from the examples that you have provided above). But it does not show the featured image in Jetpack’s Portfolio Archive page or Jetpack’s Project Type Archive page.

    I tried inserting the code above (example 3) into functions.php but doing so broke the site. Any help is appreciated.

    Kind regards

  214. Hi

    You need to update this plug in.
    It works but parts of the code ar now depracated
    in the options page you now see this warning
    Meaning you cannot set the default image.

    screen_icon is deprecated since version 3.8.0 with no alternative available

  215. Ϝor newest news you have tօ pay a quick visit world wude web and on world-wide-web I found thuis site as a best web site fοr newest updates.

  216. whoah this weblog is wonderful i really like reading your posts.
    Keep up the great work! You understand, lots of persons are
    hunting round for this information, you could aid them greatly.

Comments are closed.