I am currently hooking on the_content()
but that goes through the WordPress loop too. How can I only hook on the Single.php page?
Also, is there a way to only look on the first X posts in the WordPress loop?
By the way, I am creating a plugin
I am currently hooking on the_content()
but that goes through the WordPress loop too. How can I only hook on the Single.php page?
Also, is there a way to only look on the first X posts in the WordPress loop?
By the way, I am creating a plugin
You must be logged in to post a comment.
This will handle appending the content to single posts:
Just to add to Pippin’s answer, in my case some content were also being shown in other parts of the
single
page, e.g. sidebar. Checking justis_single()
also triggered the content modification in the other areas. Here’s another check so that only the main content will have appended stuff: