WordPress.org

Forums

How to display posts in dynamic category (2 posts)

  1. neosheva
    Member
    Posted 7 years ago #

    hi,
    i've problem while display posts from specific category in my lyric site.

    here is :

    Cat1
    Post Cat1
    -- Post Cat2
    - Child1 of Cat1
    --- Post1 Child1 of Cat1
    --- Post2 Child1 of Cat1
    - Child2 of Cat1
    --- Post1 Child2 of Cat1
    --- Post2 Child2 of Cat1
    so,
    when i'm on category "cat 1"
    only "post cat1" and "post cat2" will be shown
    if i'm on category "child1 of cat1"
    only "Post1 Child1 of Cat1" and "Post2 Child1 of Cat1" will be shown

    thank

  2. neosheva
    Member
    Posted 7 years ago #

    i've tried this

    <?php
    $categoryvariable=$cat;
    $query= 'cat=' . $categoryvariable. '&orderby=date&order=ASC';
    query_posts($query);
    ?>

    but i still can't prevent post from child category to appear

    thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags