Support » Fixing WordPress » A problem when posting in sub Cat

  • hello
    i have this problem

    when i post in a sub category the full post shows also in the parent category !!

    i want to show only partial of the post in the parent and a link to the full post in the sub .

    any help will be appreciated !!

Viewing 1 replies (of 1 total)
  • Michael


    Forum Moderator

    category archives are also showing the posts of subcategories by default;

    you would need to edit category.php of your theme (if your theme does not have one, create anew from a copy of archive.php or index.php);

    in the loop, change for example:

    <?php the_content(); ?>


    <?php if( in_category( get_query_var('cat') ) {
    } else {
    } ?>


    the post title would generally already link to the full post.
    if you want to link to the sub category instead, you also need to change the coding ot the_title() line…

Viewing 1 replies (of 1 total)
  • The topic ‘A problem when posting in sub Cat’ is closed to new replies.