I am developing a new plugin. In this plugin user can choose where the plugin will display.
If user choose only in post or archives pages then how can i find it?
if I use add_filter('the_content','function');
then my plugin will show all pages but how to do that in single category or archive page?
You can check if a specific page is being displayer with these conditonals
Also, don’t use anonymous functions when you add filters. always use defined functions
For a more complete list of template tags check visit:
http://codex.wordpress.org/Function_Reference/is_page
We use Conditional Tags:
sample code requires PHP 5.3+