WordPress.org

Ready to get started?Download WordPress

Forums

Category Icons
Category Icon Plugin needs output category icon image outside loop (2 posts)

  1. bodhi_mcgee
    Member
    Posted 1 year ago #

    Hi, Im running into trouble getting the category icon to display for the current category using the Category Icon plugin. I am trying to do this from within the category.php page.

    Ive been trying to get what i need from this page, but it only shows more complex examples using lists. I only need it to output the image for the current category nothing more.
    http://www.category-icons.com/2009/08/how-to-use-category-icons-tags-in-a-script/

    The previous code i have been using is:

    <?php
    			  if (function_exists('get_cat_icon')) {
    				$my_icon = get_cat_icon('echo=false');
    				echo str_replace('<a', '<a class="thumb"', $my_icon);
    				}
                    ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

    But this code only works 90% of the time, outputting random category icons for other categories some of the time.

    Any help much appreciated.

    Bodhi McGee

    http://wordpress.org/extend/plugins/category-icons/

  2. submarine
    Member
    Plugin Author

    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic