Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 112466

alchymyth on "A problem when posting in sub Cat"

$
0
0

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(); ?>

to:

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

(untested)

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 all articles
Browse latest Browse all 112466

Trending Articles