the_excerpt()
function in WordPress, includes the content of my h1
tag, so when trying to show a preview of a blog post on my homepage I get something like below:
“Details This is a test and testing is great.”
Details is the content of my h1
tag, which as you can see, makes no sense. I want to produce the following instead:
“This is a test and testing is great.”
How can I remove the content of a h1
tag from my excerpts.
Thanks
Have you written an excerpt for the blogpost in question?
If not excerpt is written then WordPress will automatically generate one using the first few lines of your blog post.
Also, have you tried “get_the_excerpt()” instead? Codex doc for get_the_exerpt().