Only display tribe_custom_fields() if there is a value

Home Forums Calendar Products Events Calendar PRO Only display tribe_custom_fields() if there is a value

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #45998
    James Kashetta
    Participant

    I’m using the custom fields to select a video to play in a post and using the following code:

    <iframe width="600" height="360" src="http://www.youtube.com/embed/&#8221; frameborder=”0″ allowfullscreen>

    The problem I’m running into is that I would like the iframe to only show up if there is a variable. For example I have 3 video players if the user only puts in 2 videos the 3rd one wouldn’t show up. Right now it just shows up as a broken video since it has no vars.

    I tried a few if statements and just cant seem to get it to work.

    #46009
    Jonah
    Participant

    Hi jkash23686,

    Can you share your code here so I can see what you’re working with? Please post to http://snippi.com and paste here.

    Thanks,
    Jonah

    #46037
    James Kashetta
    Participant

    Sure thing, I’m using the custom field as the video ID like so:
    http://snippi.com/s/jy6jiv0

    #46038
    James Kashetta
    Participant

    The problem I am having is that the youtube player is showing up even if there is no value set. Id like to set it up so that the player only shows if there is a value. I tried a few if statements but no dice.

    #46039
    James Kashetta
    Participant

    I just figured it out!

    http://snippi.com/s/6hzco71

    #46073
    Jonah
    Participant

    Looks good jkash23686, if you need anything else, just let us know!

    Regards,
    Jonah

    #978949
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Only display tribe_custom_fields() if there is a value’ is closed to new replies.