Forums

conditional tags within a plugin (4 posts)

  1. bikerjeg
    Member
    Posted 2 months ago #

    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?

  2. hallsofmontezuma
    Member
    Posted 2 months ago #

    What is the plugin?

  3. bikerjeg
    Member
    Posted 2 months ago #

    the plugin is the WP External Links Bar

  4. grizzdesign
    Member
    Posted 1 month ago #

    *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.

Reply

You must log in to post.

About this Topic