• The wp_list_cats can exclude category ids, for example 10 and 15 here: <?php wp_list_cats(‘exclude=10, 15’); ?>. Is there a way to list only 10 and 15 i.e include 10 and 15?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’d also like to know.

    from what i can tell, the only way would be to exclude all the categories except the ones you want to show…

    sure is a way! before the main loop starts, add

    <?php query_posts('cat=2,6,17,38'); ?>

    That’s one way. The way I prefer, since if I were to not develop the page for a while and then come back to it in 3 months and wonder wtf 2,6,17,38 are,

    is

    <?php query_posts('category_name=name1,name2'); ?>

    But anyway, you owe it to yourself to read about the query_posts() function. In my opinion, it is what makes wordpress worth using on a general purpose website at all.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_list_cats: Include instead of exclude categories’ is closed to new replies.