My personal weblog :)

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(); ?>
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>

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>

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>

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>

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/

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

187 Comments

  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?

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

  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.

    • 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.

      • 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?

        • 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

          • 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!!

    • Your atricles are for when it absolutely, positively, needs to be understood overnight.

  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!!!

    • 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(…”

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

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

    • 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.

  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

    • 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.

    • 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 :)

      • 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.

    • Ok no problem, just tell me exactly what do you want to display and I will try to help :)

      • 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.

    • 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. Free knlowdgee like this doesn’t just help, it promote democracy. Thank you.

    • Thanks so much :)

  8. I appreciate your help.

    • You are always welcome :)

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

    • 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

      • 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.

        • please tell how can i get the particular size category image

      • This plugin does not support more than one size of the image per category.

    • 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 :)

  10. 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 :)

    • 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).

      • 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; ?>

      • Hi Zahlan, with a bit of tweaking I’ve sorted it now, thanks for the great plugin :)

  11. 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

    • Thanks, please check my reply at this comment hope this would help in your case.

  12. Thanks for the great Plugin
    how to use it inside normal wordpress loop ?

    • 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 :)

      • Thanks Zahlan Worked successfully

  13. 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!

    • 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.

  14. 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!

    • 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.

  15. I was wondering if you could give an example of creating a shortcode for the category image?

    Thanks

    • Thanks, I’m not using shortcodes in my plugin yet, put thanks so much, I will update the plugin soon :)

  16. 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!

    • You can use the last example in the above documentation.

  17. 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
    );
    ?>

    • 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.

  18. Thank you very match! It is a great plugin.
    Tell me please how to make pictures with the category title.
    Example: http://mydiva.ru/serialy_online/

    On this site I used:

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

    • Thanks, please check this comment hope this would help in your case.

  19. 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

    • 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.

  20. 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!

    • you can use is_category() function in the header to check if you are in category template or not, like this example:
      < ?php
      if (is_category()) :
      if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url();
      endif; ?>
      ?>

  21. 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

    • 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 ??

      • 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

        • 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); ?>” />

        • try to put it in a text file or use this website

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

      • Wow! Thanks a million! It worked!

        • always welcome :)

  22. Hi was wondering if I can get a list of parent category images that link to sub category images that then link to their page….

    • sorry I couldn’t understand, please tell what exactly you want.

  23. 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

    • Simply you can assign the result to a variable and check if this variable is empty or not, check this code:
      < ?php
      $cat_image = z_taxonomy_image_url($cat->term_id);
      if (!empty($cat_image)) :
      ?>
      // your category image
      < ?php endif; ?>

      • Worked like a charm! Thanks a lot.
        For everyone else, here’s the code i used:

        http://pastebin.com/unbyup0x

        • Not at all :) you are always welcome

  24. 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!

    • I need a solution, i don’t know how it’s made! I try many things but don’t get it

    • which template you are in ?

      • 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

    • check this comment and replace $args = array( ‘exclude’ => ’1,2′ ); with this $args = array( ‘parent’ => 0 );

      • Sorry, but i don’t understand… :(

      • 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.

  25. I bodged the code to save image ID rather than URL. I uploaded the modified files here in case they might be of use – Hope you don’t mind.

    http://www.teamtownend.com/2012/10/categories-images-plugin-modified-to-save-image-id/

    Thanks for a great plugin.

    • 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 :)

  26. 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.

    • do you mean multiple categories for one post ?

      • 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 :)

      • Yes. Code above is not working for me.

      • I have more than one taxonomy/

    • 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.

  27. Hello,

    How can I use this outside of The Loop and with custom category?

    • In which template you want to do that ?

  28. 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?

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

  29. 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.

    • 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 :)

      • Hey, thanks for the reply.
        How do I use the TimThumb plugin with wordpress? Then how can I get it to work with your plugin?
        Thanks again.

    • Ok, there is no special use for TimThumb with WordPress, and you can use it with or without my plugin, for example all you have to do is to put this in the src attribute of the html tag img : http://www.yoursite.com/path/to/timthumb.php?src=image_url.jpg&h=180&w=120

      • Thanks for that. I managed to get it working. It works a treat!

  30. 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,

    • 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

  31. 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

    • Thanks so much, try using the 1st example (in using inside a loop) in the documentation.

  32. İşime yarayacağını düşünüyorum. Teşekkürler…

    • Eğer hoş geldiniz ;)

  33. Great plugin!
    But I have one question.
    How can I order the categories by id instead of alphabetic?

    Thank you :)

    • 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

  34. 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

    • 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

  35. 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

    • I can’t read your code here, please share it via pastebin

  36. 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

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

  37. 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

    • 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 ?

  38. 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

    • Thanks so much.
      You can find your answer in this comment :)

  39. 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

    • 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

  40. 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

    • 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.

  41. Oops, here’s the code…
    http://pastebin.com/nub0HBiv

    • 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.

  42. Good job. Thank you.

    • Thanks :)

  43. Useful plugin, I extended it a little and sent to your mail.

    • Thanks, and nice work, I already replied to your email.

  44. Hi, Great Pluggin!, Congratulations!, and thanks for built it!

    I modify your code a lillte, for show only the parent Category Images :)

    http://pastebin.com/2yP5ZUKJ

    Greetins!

    • Thanks so much :)

  45. thanks. Great Pluggin!, Congratulations!,

  46. On WordPress 3.5 the image is not shown….uhmmm

    • this issue had been solved :)

  47. On WordPress 3.5 the image is not shown..uhmm

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

  48. 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

    • 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

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

    Thanks for your help

    • sorry can’t understand, can you tell exactly what you want to do ?

  50. 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?

    • I think you are talking about html and css :) so you can do what ever you want

  51. 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

    • sorry I can’t get you, you mean you want to put images for tags ?

  52. 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

    • have you tried one the examples in the post ?

  53. There is a support item on the wordpress site http://wordpress.org/support/topic/specify-which-taxonomies-to-use-with?replies=4
    which looks like an enhancement request.
    However, because the taxonomies cannot currently be specified this plugin conflicts with any other plugin or code that uses taxonomies and images. The WooCommerce eshop plugin is a prime example of this.

    • I will have a look to this issue, Thanks for reporting it.

  54. 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!

    • Thanks, I didn’t use IE6 since ages ago, but I will check it for you.

      • 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

        • I think your problem with css and html, so in this case I can’t help you :)

          • 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!

          • Hey actually you were right, the width: 100% isn’t supported by IE7 so that was the issue. Thanks man

    • you are always welcome :)

  55. 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

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

  56. 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.

    • I don’t know why your comment was in the spam, I just noticed it. please upload your code to pastebin so I can help you.

  57. 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,

    • have you tried the example above ?

  58. amazing plugin. How can I show only parent categories and on hover show subcategories?
    Help would be appreciated

    • Thanks, please check the comments above, you will find what you want.

      • Im not sure if you meant by this comment
        9 );

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

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

        But it dosent work for me.
        Im trying to do it like this wordpress function

        http://codex.wordpress.org/Template_Tags/wp_list_categories

        • I want to show all categories available on site

  59. Great plugin, thanks! works perfectly

    • Thanks :)

  60. Man, you have helped me a lot. Thanks!

    • Thanks ;)

  61. 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).

  62. is it possible to reverse the order.. so with my example, number 40 will be at the top

    • Yes, you can do that by using the ‘order’ parameter, for example:
      < ?php get_categories(array('order' => ‘desc’)); ?>

      Please check the WordPress Codex for more parameter and examples.

      Thanks.

  63. Nice Plugin

    • Thanks :)

  64. 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

    • Thanks so much.

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

  65. 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 .=”;

    • I can’t guess what is the problem here, so if you don’t min please upload the full code to pastebin

  66. İlgi çekecek bir içerik.
    Kullanılabilir, teşekkürler.

    • teşekkürler :)

  67. http://pastebin.com/AYfrb14N SEE CODE

    THANKS FOR ATTENCION

    • 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.

  68. 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');

    • 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

  69. Thank you very Much !

    You saved My Life… Awesome Plugin !

    • Thanks so much :)

  70. 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

    • 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.

      • Great that it works for you

Trackbacks/Pingbacks

  1. Categories images plugin modified to save image ID | Ed Townend - [...] very quickly (and badly) hacked up Zahlan’s excellent Categories Images plugin to save image IDs rather than the absolute ...
  2. Wordpress Kategorilere Resim Ekleme | Uğur ÖZER - [...] http://zahlan.net/blog/2012/06/categories-images/ [...]
  3. Matrak Site » Blog Archive » WordPress Kategorilere Resim Ekleme - [...] http://zahlan.net/blog/2012/06/categories-images/ [...]
  4. Categories Images wordpress plugins seo | wordpress plugins - [...] Go to http://zahlan.net/blog/2012/06/categories-images/ [...]
  5. Categories Images wordpress affiliate plugins plr | wordpress plugins - [...] Go to http://zahlan.net/blog/2012/06/categories-images/ [...]

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>