• I am modifying a plugin to only work on certain pages. I thought I could use conditional tags from within the plugin but it seems that the plugin runs before the $wp_query is initialized with values so the “is_” conditional functions don’t actually return true or false but calling function_exists for is_single() and so on return true.

    How can I determine conditional tags on my own or another way within a plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    What is the plugin?

    Thread Starter bikerjeg

    (@bikerjeg)

    the plugin is the WP External Links Bar

    *bump*

    Can we, and if so, how can we use conditional tags inside plugins ?
    Or… how can we make a plugin only load on a certain page (to save load with both parties).

    Like only load plugin X on homepage, only load plugin X if is_admin, only load plugin X if is_single, all kinds of stuff.

    PS: I think is_admin() does work though.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘conditional tags within a plugin’ is closed to new replies.