[resolved] Get the type of page for filter? (3 posts)

  1. hategrinder
    Posted 7 years ago #

    Hello! If I want to apply 'the_content' but only if it it is going to show as a single post? I don't want anything to be done on tag or category pages. How can I add filter only to single post page? Thanks!

  2. Kafkaesqui

    Posted 7 years ago #

    if( is_single() ) {
    	apply_filters('the_content', ...

    Alternatively (and how I typically handle it), you can place the conditional test within your plugin's function apply_filters() calls to decide what to return based on it.

  3. hategrinder
    Posted 7 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic