• I’m trying to get the list of Categories to display in the Categories widget.

    I’m developing this site locally on my laptop… Apache, MySQL, PHP 5.
    I found a post here on this forum suggesting I could edit this line found in the header.php file…

    <?php wp_list_categories('title_li=&exclude=' . $GLOBALS[asides_id]) ?>

    The suggestion was that it should be changed to this…

    <?php wp_list_categories('title_li=&exclude=&hide_empty=0' . $GLOBALS[asides_id]) ?>

    However there no such line in header.php in fact no “wp_list_categories…”
    The only place I find any such line is in sidebar.php and sidebar2.php. and those lines read as so…

    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

    Apparently in the above mentioned suggestion the edit used the addition of this bit…

    &hide_empty=0

    And presumably that will cause WP to display all the Categories I’ve created, regardless of whether or not they have any content i.e. “post”. In other words, empty categories.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ronc0011

    (@ronc0011)

    Seems I can’t get a post to this board constructed and completed in its entirety the first time through.

    I really think the WordPress forum could due with an “edit” option on the “new post” function.

    Anyway, the point is… I need to find out how to get WP to display all the Categories I’ve created empty or otherwise.

    Any help greatly appreciated.

    Moderator bcworkz

    (@bcworkz)

    I don’t understand what trouble you’re having. Simply placing the Categories widget in the sidebar in the Widgets admin screen will cause categories to be listed in the sidebar. You cannot use widgets anywhere except in areas your theme designates as sidebars. Sidebars may appear in other places, like the footer, but the theme needs to provide the location.

    Outside of the sidebars, wp_list_categories() will display a list of categories where ever you place it on a template, provided it’s in the <body> section. header.php is largely for the <head> section, not a good place for a category list. Typically, there is a <head> tag somewhere on header.php, be sure the template tag is placed below this.

    Each theme’s header.php is somewhat different, so instructions to replace a particular bit of code may not apply unless we’re dealing with the exact same theme and version.

    The forum allows edits of your post for a short period after posting, maybe 30 minutes or less. After that it’s locked in and you cannot change anything. The ability to edit posts much later can cause subsequent posts referring to edited content to not make any sense. It’s better to post a correction instead of editing.

    Is the trouble you have posting related to a “Secure Connection Failed” screen? It’s a Firefox 46 bug, fixed in 47. If you just click “Try Again”, then “Resend”, the post will go through.

    If your post seems to go through normally but just does not show up, it may have gotten caught in the spam queue. There is no logic to what the spam filter considers spam. If you’re not a spammer, your post will be released shortly, just be patient.

    get the list of Categories to display in the Categories widget

    suggestion the edit used the addition of this bit…
    &hide_empty=0
    And presumably that will cause WP to display all the Categories I’ve created,

    to influence the behaviour of the default widgets, you need to work with filter functions;

    to add the hide_empty=0, try to add this to functions.php of your theme:

    add_filter('widget_categories_args','show_empty_cats');
    function show_empty_cats($args) {
    $args['hide_empty'] = '0';
    return $args;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show Categories?’ is closed to new replies.