• makwak

    (@makwak)


    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: https://mydomain.com/tag/mykeyword

    Probably a simple answer! Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Evita

    (@evita)

    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 //
    else
    // this is my keyword-text

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

    Chris_K

    (@handysolo)

    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.

    Thread Starter makwak

    (@makwak)

    ok, what do I run with!
    In actuality, the query is like:
    https://mydomain.com/index.php?tag=mykeyword

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

    or?

    Thread Starter makwak

    (@makwak)

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

    works lovely.

    Thread Starter makwak

    (@makwak)

    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?
    Thanks.

    Chris_K

    (@handysolo)

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

    Kafkaesqui

    (@kafkaesqui)

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

    https://php.net/manual/en/reserved.variables.php#reserved.variables.get
    https://php.net/isset

    Chris_K

    (@handysolo)

    Thank you Kafkaesqui.

    Thread Starter makwak

    (@makwak)

    Well once again I am lost. Here is what I tried:
    https://www.mw2mw.com/marek/temp/conditional.txt
    using Kafkaesui’s code…
    when I tried it here:
    https://mw2mw.com/tag/installation
    I don’t get the content at the top, which I do get for categories…

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Jerome’s Keywords – condition tag, how?’ is closed to new replies.