• I’m trying to list all posts from a parent category and its sub-categories.

    if (is_category('4,6,9')) {
    ?>
    
    <?php $categories = get_categories("child_of=$cat-id");
    
    foreach ($categories as $cat) {
    	query_posts("cat=$cat->cat_ID&showposts=-1&order=ASC&orderby=name");

    I would like $cat-id to be either 4, 6 or 9 depending on which category page the user is looking at.

    How do I make this happen?

  • The topic ‘Pass variable to get_categories function’ is closed to new replies.