Support » Fixing WordPress » Categories and sub-categories displaying in sidebar

  • Resolved posiesplace


    Would someone be able to help me out with some coding advice, at the moment I retrieve my categories with the following code:

    <h2><?php _e(‘Categories’); ?></h2>
    <?php list_cats(0, ”, ‘name’, ‘asc’, ”, 1, 0, 1, 1, 1, 1, 0,”,”,”,”,”) ?>
    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    <?php get_links_list(); }?>

    This displays all my categories in one list but since I have some sub-categories and I would like these to be shown as sub-categories in my sidebar.

    How do I go about this?

    Many thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • moshu


    You could replace the template tag used in your sidebar with something else, and/or play with the parameters:

    (BTW, only this line of code is displaying your cats:
    <?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','','','') ?> – everything after that is for Links/Blogs)



    From that codex entry I think the parameter I want is

    <?php list_cats()>

    (boolean) Sets whether to display child (sub) Categories in a hierarchical (after parent) list. Valid values:

    * TRUE (Default)
    * FALSE

    How do I go about implementing this?

    I have tried a couple of things but so far nothing has worked.

    Any help would be really appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Categories and sub-categories displaying in sidebar’ is closed to new replies.