• Suppose I have categories structure Like:

    FRUITS
    |----APPLES
    |----GRAPES
    |----MANGO
    |----BANANA
    |----PINEAPPLE

    when i post something in “Apples” category its available only while visiting that category. But no post is shown in ‘FRUITS’ section.

    For that i have to add two categories for each post “FRUITS, APPLES”. It is very difficult to edit thousands of old posts & add two categories.

    I am looking for some function or hack so while visiting parent category, automatically display posts from its all child categories.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter PuNK DeSi

    (@ades_ting)

    I want to achieve this without any plugin.
    earlier i tied this:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	   query_posts("cat=14,15,16,17,42&paged=$paged");

    but this requires inclusion of all child categories & custom template then change categories number again in case of new child.

    I want similar functionality without specifying numbers i.e. automatically detect parent category & then include all its child in the query & display all posts from child.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Include posts from all child categories on parent page.’ is closed to new replies.