[resolved] I dont want to see all the post in father categories (2 posts)

  1. interespacios
    Posted 9 years ago #


    I want create a categories menu with 3 lebels child fathers and .... well, in fact I already do that but when I write a post in child, this post is show in father and father/father categories, I want to show just the post to belong to a categorie

    What Can I do?

  2. interespacios
    Posted 9 years ago #

    I will reply this for my self, I just look arround for a while and find this: It works OK
    I just copy and paste here

    hi i post this 'cos it's a way to refresh an old post i found on this forum http://wordpress.org/support/topic/71767
    and some of you may be interested...
    Well, the goal is that each category displays only its own posts and not those of its child categories.

    here you go:
    (this in WP v.2.0.4, line numbers may change in further versions)

    open wp-includes/classes.php
    just insert // at the very beginning of these lines - or destroy them:
    line 473
    $whichcat .= get_category_children($cat_array[0], ' '.$andor.' category_id '.$eq.' ');

    line 476
    $whichcat .= get_category_children($cat_array[$i], ' '.$andor.' category_id '.$eq.' ');

    line 514
    $whichcat .= get_category_children($q['cat'], " OR category_id = ");

    You're done! Code is poetry, as they say!

Topic Closed

This topic has been closed to new replies.

About this Topic