WordPress.org

Ready to get started?Download WordPress

Forums

Category Icons
[resolved] Only show icons for post categories (6 posts)

  1. sidkhullar
    Member
    Posted 1 year ago #

    Could you help me with configuring your plugin to only show icons for categories the post is assigned to.

    My site has restaurant reviews and I'd like the widget to show category icons on the right hand side sidebar, only for ratings (categories) the post is assigned to.

    Do you think that's possible?

    Stay well.
    Sid

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

  2. submarine
    Member
    Plugin Author

    Posted 1 year ago #

  3. sidkhullar
    Member
    Posted 1 year ago #

    Thank you; but when I do as the link says, and enter numbers of the three categories I want to include (thumbs up, thumbs down, average), I see a list with only icons (which is good)... all three of them. Not the single one assigned to the post.

    Was I able to convey my issue? :)

  4. submarine
    Member
    Plugin Author

    Posted 1 year ago #

    I have no idea how to know to which category a post belongs to from the sidebar...

  5. sidkhullar
    Member
    Posted 1 year ago #

    Understood; thank you. :)
    I'll try and modify the single post template to automatically include them in the post area.

  6. submarine
    Member
    Plugin Author

    Posted 1 year ago #

    If you use the single post template with a widget, you can paste this in your functions.php :

    add_filter('widget_text', 'do_shortcode');
    add_shortcode('caticons_listing','bm_icon');
    function bm_icon() {
    	global $wp_query;
    	$the_post_id = $wp_query->post->ID;
    	get_cat_icon($the_post_id);
    }

    And add a text widget, with the short code in it :
    [caticons_listing]

    I've written a tutorial a bit different here : http://www.category-icons.com/2012/09/display-a-list-of-categories-with-description-in-a-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.