Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Can’t get this Conditional Statement to work in WordPress

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41795
    Preeminent
    Participant

    Can anyone point me in the right direction with this? I’m trying to get the following statement to work in my wordpress theme:

    [PasteBin Link](http://pastebin.com/BsQmzdsX “PasteBin Link”)

    I need to have that H3 title show only when the post has a tag of “awesome”. It’s not working. Nothing is showing at all.

    Thanks!

    #120351
    Preeminent
    Participant

    if( has_term( ‘awesome’, ‘product_tag’,$post->ID ) ) { ?>



    Is what I’m trying to do. Anyone see why this wouldn’t work?

    #120354
    davidlab.be
    Participant

    @Preeminent if you are inside the loop then leave out the $post->ID.

    #120481
    Preeminent
    Participant

    I wish man. No go. Thanks for your input though! It’s weird. Seems simple enough for it to work.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.