• Hi there,

    I am trying to create a custom page whereby I can create a loop that just brings in category 10. I am doing this with the code below:

    <?php query_posts('cat=7'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    //do stuff here
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    ?php endif; ?>

    Inside this loop (do stuff here) I want a query that will get all the sub catefories of category 10 and display each of them in a seperate div, then I can style them. I actually want to pull a custom field once I have queried them so that I can display them something like this page:

    http://www.ribbweb.org/ict/?cat=19

    I am just not sure of the code to go in the do stuff here part. Any ideas anyone. Much appreciated.

    Thanks

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

    (@equaldesign)

    I could use the child_of=n where n is the category ID however as this is on the wp-list_categories function it will just display the page title as a list and therefore I cannot being in other information.

    Thread Starter equaldesign

    (@equaldesign)

    I suppose in plain English this is what I want to do.

    Query all sub categories of category 10 and while it has sub categories show them.

    For each sub categories wrap them in a div with a class called subcats

    For each sub category inside subcats display the category description and category title.

    I’d like to bump this in hopes that someone may know the answer???

    or equaldesign, have you found a solution?

    thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get Sub Categories through Query Posts’ is closed to new replies.