• Resolved MACscr

    (@macscr)


    I am trying to list a child category, though its the only category i want to output (im trying to help resolve an issue within a menu plugin). Anyway, when i try something like:

    <?php wp_list_categories("title_li=&hide_empty=0&include=12");?>
    it outputs ‘No Categories’, then it works fine if I changed that 12 to a 10, which is a parent category.

    Is this a bug?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Don’t think it is a bug…try this:

    <?php
    $cat_id = get_cat_ID('Features'); //put your category here
    wp_list_categories('title_li=&hide_empty=0&include='.$cat_id);
    ?>

    Thread Starter MACscr

    (@macscr)

    Does the same thing, still states ‘Now Categories’. I have tried it with two different subcategories. Same result.

    I don’t have that problem. Make sure wp_list_categories('title_li=&hide_empty=0'); lists all your categories.

    Thread Starter MACscr

    (@macscr)

    But i dont want to list all categories. I only want the results for a single category. Thats the whole point of the “include” option.

    Understood. But wanted you to make sure that listing all categories did in fact list the child category you are attempting to display.

    In lieu of that, deactivate all plugins, switch to the WordPress Default theme and try the code in the sidebar.php of that theme.

    Thread Starter MACscr

    (@macscr)

    Thanks for the idea about the plugins. I should i have tried that earlier. For some very weird and odd reason, the role scoper plugin was causing the issue, even though all the settings for it are at default and i checked those categories and they are set to allow by all. Anyway, its disabled and everything is good to go now. Woo hoo!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘wp_list_categories() and child category’ is closed to new replies.