WordPress.org

Ready to get started?Download WordPress

Forums

Category Icons Lite
[resolved] Duplicate icon (4 posts)

  1. Ruriko
    Member
    Posted 2 years ago #

    I pasted this code <?php if (function_exists('get_cat_icon_lite')) echo get_cat_icon_lite();?> into my loop and it's showing 2 icons instead of 1. How to fix this?

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

  2. submarine
    Member
    Plugin Author

    Posted 2 years ago #

    Could you paste your loop code, please ?

  3. Ruriko
    Member
    Posted 2 years ago #

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    <div class="border">
    <div class="pic"><a href="<?php echo get_permalink(); ?>"><?php if (function_exists('get_cat_icon')) get_cat_icon('link=false'); ?></a></div>
    <div class="ep"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a><br />
    <?php the_time('F j, Y'); ?></div>
    </div>
    <?php endwhile; // end of the loop. ?>
    		<?php comments_template( '', true ); ?>
  4. submarine
    Member
    Plugin Author

    Posted 2 years ago #

    I believe I understand why you have 2 icons displayed instead of one. I wrote the Category Icons Lite plugin in order to display the icon automatically. So there is one icon displayed. Now, in your code you add one icon using echo get_cat_icon_lite() (and not get_cat_icon(), which is related to my other plugin). So you have 2 icons.

    You have 3 solutions :
    1. You delete the call to the function get_cat_icon_lite() and let the plugin do the job.
    2. You're calling get_cat_icon_lite() because Category Icons Lite does not display the icon where you want to, and in this case, you have to be patient : in the next release of this plugin, you'll be able to disable the display of the icon in front of the title in order to use get_cat_icon_lite() (or not). You can test the beta, if you want.
    3. Or you can use Category Icons exactly as in the code you provided.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.