WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Category Icons] Widget stopped displaying icons

[Resolved] [Plugin: Category Icons] Widget stopped displaying icons

  • Echtzeit
    Member

    @echtzeit

    Hello there,

    everything with this wonderful plugin worked literally for years, but yesterday I clicked on “Position of the category icons in the sidebar” on “Right” and then all the icons in the widget disappeared.

    Even after changing it back to left and trying pretty much everything I could think of, the icons just won’t come back. Any ideas on how to show them again?

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

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author submarine
    Member

    @submarine

    Hi,

    What is the value in your database, in the wp_options table, of the option “igcaticons_before_name” ? If it is set to false, what happens if you set it to 0, instead ?

    Echtzeit
    Member

    @echtzeit

    It’s set to true.

    Plugin Author submarine
    Member

    @submarine

    If you set it to 1, instead, it is working ?

    Echtzeit
    Member

    @echtzeit

    Changed it to 1, deleted the widget in the sidebar and added it again. Nothing has changed.

    Plugin Author submarine
    Member

    @submarine

    If you go in the icons panel, are you able to view the icons ?

    Echtzeit
    Member

    @echtzeit

    Yeah. Everything concerning the plugins works as intended (as far as I’m using it).

    Plugin Author submarine
    Member

    @submarine

    This is uber weird.
    Did you try this :

    • test the widget in another theme ?
    • deactivate, delete it and reinstall the plugin ?
    Echtzeit
    Member

    @echtzeit

    I have it installed on two other blogs and it works just fine. It did work here too for more than a year, until I changed that setting.

    Deactivating and reinstalling did nothing.

    I’m trying to replicate what the widget does in a different widget (that can handle php), but find it rather hard, cause I’m not a programmer.

    Plugin Author submarine
    Member

    @submarine

    Echtzeit
    Member

    @echtzeit

    Oddly enough, this actually works! I can’t thank you enough.

    Only ONE tiny thing missing, though. I need the categories to display hierarchical and I’ve tried tampering with the code, but couldn’t get it to work. Could you tell me how to do this?

    After that I’m most definitely gonna buy you a coffee 😉

    Plugin Author submarine
    Member

    @submarine

    I think this should do the job :

    function bm_caticons_listing() {
    	$lis = array();
    	// Get the categories
        foreach(get_categories() as $category) {
           $link = '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a>';
           $lis[$category->cat_ID] = '<li>'.get_cat_icon("echo=false&cat=".$category->cat_ID).' '.$category->description.' '.$link.'</li>';
        }
    
        // order the categories
        $r = array('orderby' => 'name', 'order' => 'ASC', 'hierarchical' => true, 'echo' => 0, 'hide_empty' => 0);
        $depth = 0 ;
        $order = bm_caticons_walk_tree(get_categories( $r ), $depth, $r );
        $order = explode(',',$order);
    
        $listing_code = '<ul>';
        foreach ($order as $index) {
    	    $listing_code .= $lis[$index];
        }
        $listing_code .= '</ul>';
        return $listing_code;
    }

    Echtzeit
    Member

    @echtzeit

    Almost, but still not quite there 🙁

    Have a look for yourself: http://letsgetdigital.de/

    Everything underneath “Genre” up to the next icon is a child category, but it’s not shown correctly (indented).

    Also, I tried to add

    'show_count' => 0,

    to

    // order the categories
        $r = array('orderby' => 'name', 'order' => 'ASC', 'hierarchical' => true, 'echo' => 0, 'hide_empty' => 0);
        $depth = 0 ;
        $order = bm_caticons_walk_tree(get_categories( $r ), $depth, $r );
        $order = explode(',',$order);

    but it just won’t show the number count.

    Plugin Author submarine
    Member

    @submarine

    I must admit I was very tired yesterday. Here is a much simpler solution :

    function bm_caticons_listing() {
        echo '<ul class="theicons">';
    	put_cat_icons(wp_list_categories('title_li=&echo=0&show_count=1'),'small=false');
    	echo '</ul>';
    }

    Echtzeit
    Member

    @echtzeit

    So the complete code should look like this now?

    add_filter('widget_text', 'do_shortcode');
    add_shortcode('caticons_listing','bm_caticons_listing');
    function bm_caticons_listing() {
        echo '<ul class="theicons">';
    	put_cat_icons(wp_list_categories('title_li=&echo=0&show_count=1'),'small=false');
    	echo '';
    }

    Cause if that is correct, it now remedies the concerns I had before, but now the categories are shown outside the widget AND there are no icons…

    http://letsgetdigital.de/

    Plugin Author submarine
    Member

    @submarine

    Ah, sorry, in fact, it should be :

    add_filter('widget_text', 'do_shortcode');
    add_shortcode('caticons_listing','bm_caticons_listing');
    function bm_caticons_listing() {
        $listing_code = '<ul class="theicons">';
        $listing_code .= put_cat_icons(wp_list_categories('title_li=&echo=0&show_count=1'),'small=false&echo=false');
        $listing_code .= '</ul>';
        return $listing_code;
    }

    But I don’t know why it’s not working for you… Could you execute this query and tell me the result, please ?

    SELECT * FROM  wp_options
    WHERE  option_name LIKE  'igcaticons%'

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘[Resolved] [Plugin: Category Icons] Widget stopped displaying icons’ is closed to new replies.