WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] please help with has_tag functions (4 posts)

  1. re-end
    Member
    Posted 5 years ago #

    Hi,
    For the first time, my apologize for my bad english.
    I have problem using has_tag function.

    In my blog, theres two language I use to post, its 'bahasa' (Indonesian) and the other language is 'english'.

    Then I want customize my banner on sidebar followed by language that I use. If my post in bahasa, the banner's apperance will difference with english post version. So, I added tags 'bahasa' in my post if I write in 'bahasa'.

    And I put this code in the sidebar :

    <?php
    if (has_tag('bahasa')){
         Banner A
    } else {
         Banner B
    }
    ?>

    But, it didnt work. Banner B is always show eventhough the post is in bahasa, so Banner A is never appeared.

    I had read this this
    but its not help me.

    Would you like to help me to resolve my problem with has_tag function.
    Thank You

  2. MichaelH
    Member
    Posted 5 years ago #

    I wonder if you this post by Nathan Rice might not help you.
    http://www.nathanrice.net/blog/wordpress-single-post-templates/

  3. re-end
    Member
    Posted 5 years ago #

    Thanks for the response...

    Yes, its not help me out. Nathan Rice post is based category. What i want is ordered by tags.

    When I try using is_tag functions the code is working. But it just work for tags archive page, in single page my problem still appear.

    Would someone help me please?

  4. re-end
    Member
    Posted 5 years ago #

    Hi,
    After trial and error, it seem has_tag function cannot use in sidebar.
    How I can use this function in my sidebar?
    Please any suggestion?
    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags