I am building a plugin that is only useful and should only run on pages where posts are featured.
Is there a way to only run the plugin on pages that display posts?
I am building a plugin that is only useful and should only run on pages where posts are featured.
Is there a way to only run the plugin on pages that display posts?
Comments are closed.
No, the plugin is loaded long before WordPress has figured out if it should display a single post.
But you can restrict the code of the plugin to do something only then.
Example: