Show Excerpts on Category pages instead of full posts

Hi,

How do I ensure only excerpts of a post show on category pages instead of the full post? Or even the title.

I have found the Archive.php file however am unsure of what to edit.

Hi @fez27,

I hope you are well today and thank you for your question.

To achieve this first you have to create child theme of Sparkling theme then copy /template-parts/content.php file in to child theme /template-parts/ directory and change the following code on line number 50 on it.

Before:
<?php if ( is_search() ) : // Only display Excerpts for Search ?>

After:
<?php if ( is_search() || is_category() ) : // Only display Excerpts for Search ?>

Best Regards,
Movin

Thanks, it worked!
I wanted to see how it looked without excerpts so I replaced excerpt with title and that worked too.

Is there any way of removing the featured images? So it simply displays a list of post titles?

Faisal

Is there any way of removing the featured images? So it simply displays a list of post titles?

You can remove featured images by changing the below code in the /template-parts/content.php file on line number 11

Before:

<?php
if ( is_page_template( 'page-fullwidth.php' ) ) {
	the_post_thumbnail( 'sparkling-featured-fullwidth', array(
		'class' => 'single-featured',
	) );
} else {                    the_post_thumbnail( 'sparkling-featured', array(
	'class' => 'single-featured',
) );
}
?>

After:

<?php
if ( is_page_template( 'page-fullwidth.php' ) || ! is_category() ) {
	the_post_thumbnail( 'sparkling-featured-fullwidth', array(
		'class' => 'single-featured',
	) );
} else if( ! is_category() ) {                    the_post_thumbnail( 'sparkling-featured', array(
	'class' => 'single-featured',
) );
}
?>