My theme shows full posts on the main page and I want it to show only the summary, I tried searching for the_content tag in my theme’s index.php file but it is not even there!
I don’t have a home.php or category.php. I tried searching my whole wordpress installation for the_content and the only places i could find it is in page.php and even when changing it there it doesn’t really work.
The other places I found it in my theme formats (image.php, audio.php…) but changing it there makes the post shows the summary even when you click on it and go inside the post.
My index.php file has this :
<?php if (have_posts()) : while (have_posts()) : the_post(); $format = get_post_format(); ?>
<?php if($format == ''): ?>
<?php get_template_part('library/functions/theme/formats/standar'); ?>
<?php else: ?>
<?php get_template_part('library/functions/theme/formats/'.$format); ?>
<?php endif; ?>
<?php endwhile ?>
Do I need to do something specific there to make this work?
Decide about
the_excerpt()
orthe_content()
with a conditional:is_singular()
.You can use a plugin and filter
the_content
depending on the current pageâs type: archive or singular. But you can use it in your theme too.In your theme find the line where you are calling
the_content()
. Change it to:What theme are you working with?
This bit of code here:
Seems to suggest that your index.php is calling an template include. If you find the correct file (most likely located in that formats/standar directory) and replace the spot where the_content() appears with the the_excerpt(), you should see the summaries loading instead of the full content. This is going to modify a core theme file which is not recommended, so without knowing more about your theme and whether or not this is overridable I would say do it at your own risk.