That function is invoked from the templates of the wordpress theme that you are using, and depending on the theme, it will be added in certain places and not in others.
This means that:
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
get_sidebar();
get_footer();
?>
Just as you present it, may not be literal in any of the templates of your theme . The only thing you will find in them, whatever the theme, is the use of the_content();
. And that's what you want to modify. The wrapper you're trying to follow was probably for another theme.
Within your theme, there are templates (for example single.php
and page.php
where it does not make sense to present the excerpt
), while in others, which today display the full post, what you you want is, in exchange, to display only one intro plus a link that says: "Read more".
In summary : Within the theme you're using, you should find which templates use "the_content ();"
As I said before, there are templates where it is not appropriate to change ( single.php
and page.php
if your theme has them), and others that do not print posts, as functions.php
. Some candidates, within your theme, can be called:
- index.php
- category.php
- tag.php
- loop.php
For no reason you're going to get into modifying wp-includes/post-template.php
. What you want to do must be strictly in your theme.
If you want more help, supplement your question by listing the files that are inside the folder of your current theme.