The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Jerome's Keywords - condition tag, how? (10 posts)

  1. makwak
    Posted 9 years ago #

    elseif(is_tag('mykeyword')) { some stuff here }
    At the top of the searchpage for a keyword, using Jerome's Keyword plugin, I want to add some content, but what is the correct conditional tag? (Obviously is_tag doesnt exist).

    Where the tag page would be like: http://mydomain.com/tag/mykeyword

    Probably a simple answer! Thanks.

  2. Evita
    Posted 9 years ago #

    Oh my good, I hate my bad English - hope you can understand my posting.
    In my opinion, conditional tags works only for wordpress "stuff" and not for plugins. So if you want to display some content for the keyword you only can do it if you exclude all your other sites, e.g.

    if is_home, is_category, is_page, is_single, is_search, is_error404, is_day, is_month, is_year
    //do nothing //
    // this is my keyword-text

    It works for me, but maybe there is a simpler way.

  3. Chris_K
    Posted 9 years ago #

    After doing a search on a tag, what's the querystring for that resulting page?

    Is it like any other WP Search where "s" has the searched for value? If so, just grab it out of the query string and run with it.

  4. makwak
    Posted 9 years ago #

    ok, what do I run with!
    In actuality, the query is like:

    so what do I put:
    elseif(is('index.php?tag=mykeyword')) { some stuff here }


  5. makwak
    Posted 9 years ago #

    ok I am dumb.
    elseif('index.php?tag=mykeyword') { some stuff here}

    works lovely.

  6. makwak
    Posted 9 years ago #

    No I was wrong, the above also works for all keywords, not just a single specific one. So is there anything out there that explains this?

  7. Chris_K
    Posted 9 years ago #

    My PHP-fu is weak... but you want to get the value of the query string variable "tag" and use that in your compares.

  8. Kafkaesqui

    Posted 9 years ago #

    elseif( isset($_GET['tag']) && ('mykeyword' == $_GET['tag']) )


  9. Chris_K
    Posted 9 years ago #

    Thank you Kafkaesqui.

  10. makwak
    Posted 9 years ago #

    Well once again I am lost. Here is what I tried:
    using Kafkaesui's code...
    when I tried it here:
    I don't get the content at the top, which I do get for categories...


Topic Closed

This topic has been closed to new replies.

About this Topic