Forums

How to exclude child category posts in parent category (3 posts)

  1. StoreMyPic
    Member
    Posted 4 months ago #

    That is currently controlled by this code

    <?php
    $cat = get_query_var('cat');
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('showposts=20&paged=' . $paged .'&cat='.$cat);
    $wp_query->is_archive = true; $wp_query->is_home = false;
    ?>

    Thanks

  2. Shane G
    Member
    Posted 4 months ago #

    Hi,

    Refer this article which will help you to setup exclude/include category..

    http://codex.wordpress.org/Template_Tags/wp_list_categories#Include_or_Exclude_Categories

    Thanks,

    Shane G.

  3. StoreMyPic
    Member
    Posted 4 months ago #

    Thanks Shane

    But its not working

Reply

You must log in to post.

About this Topic

Tags

No tags yet.