I am getting post excerpt content with this code.
echo the_excerpt();
And also I am getting full post. content with this code
$content = get_the_content();
echo $content;
But I don’t want full content. I want to show the content without the excerpt content.
if the full content is this:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry."
excerpt is this:
"Lorem Ipsum"
then the content without excerpt will be show this:
"is simply dummy text of the printing and typesetting industry."
I want to set word count while displaying the content without excerpt.
I have tried multiple code to achieve this but not get any solution. Kindly help me with this.
2
Answers
The above code is not replacing HTML tags. I figured out some code which can replace tag also...
You can call content function like that:
null – to do not show "read more", and true – to remove initial text before <–more–>:
More in docs:
https://developer.wordpress.org/reference/functions/the_content/
Or if above not working for you, you can use not a nice solution, but 100% working with str_replace: