WordPress.org

Forums

display single post from all child category (3 posts)

  1. Rishi
    Member
    Posted 2 years ago #

    hello
    i need to display single post from all child category of a parent category.Please help me out in finding the solution for this.my category structure is like this
    -category 1
    --category 1.1
    --category 1.2
    --category 1.3
    -category 2
    --category 2.1
    --category 2.2
    --category 2.3
    -category 3
    --category 3.1
    --category 3.2
    --category 3.3
    what i need to do is when someone click on category 1, it should display a list of post from all category

    thank you in advance

  2. Rishi
    Member
    Posted 2 years ago #

    Hello
    I forgot to mention one important point
    right now when someone click on category 1 i am displaying the post which is under category 1.i need to display the post under category one and also need to display a list kind of or you cna say display the thumbnail and Excerpts of all the post of child category

  3. artsmc
    Member
    Posted 2 years ago #

    Hello, I'm sure there are many solutions. You may want to search for a function that could do that. Until then a patch fix would be create a custom category page for each of those categories. Then inside query the post
    Category 1.php

    <?php query_posts('cat=1.1&showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    Display Content
    <?php endwhile; ?>
    <?php query_posts('cat=1.2&showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    Display Content
    <?php endwhile; ?>
    <?php query_posts('cat=1.3&showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    Display Content
    <?php endwhile; ?>

    hope that help

    [sig moderated as per the Forum Rules]

Topic Closed

This topic has been closed to new replies.

About this Topic