I’m using WordPress 3.0.1 with the Twenty Ten theme. I’m trying to change the way the posts in the Category view are displayed (i.e. by going to a url like mywebsite.com/category/mycategory). Currently the posts in the Category view just show the first part of a post, but I’d like to change that so it shows the whole thing.
In the Category Template (category.php) file, there are a few lines of code that look like they are responsible for generating the category data:
/* Run the loop for the category page to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-category.php and that will be used instead.
*/
get_template_part( 'loop', 'category' );
?>
Since the comments mention setting up a child theme, I went ahead and followed these instructions (via this answer) to set up a child theme so I could add my custom functionality.
I see from the comments that I’m supposed to create a file called loop-category.php with my custom implementation, but I don’t know what code I need to put in that file. What do I need to add to loop-category.php to get Category views to show up with full blog posts?
NOTE: While I’ve been using WordPress for quite a while, this is my first dive into theme customization. Any help would be much appreciated.
@Ben,
If you look at line 132 of loop.php in Twentyten you will find the conditional statement that is telling WordPress to only display the_excerpt on category archives. Right below that after
<?php else : ?>
is how all posts that are not on an archive page, in the asides category or in the gallery category will be displayed. (The asides and gallery categories are targeted at the beginning of loop.php)In your loop-category.php file the easiest thing to do would be copy and paste the whole loop.php file and change the section of code above to:
You will notice that we only removed
is_archive
from the conditional statement so now category archives will displayed using the code after the else statement which containsthe_content
as opposed tothe_excerpt
.I just removed the second instance of “is_archive() || ” from loop.php and got each entire post to show up on the category/catslug page. I didn’t have to create a loop-category.php file. I couldn’t have done it with out Chris_O’s instructions. Thanks, Chris!!