Jump to content

alanzap

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by alanzap

  1. Thanks Ch0cu3r, looking at the result of that made me see an earlier error. Have it sorted now. Much appreciated!
  2. Thanks for looking, If the field is filled it shows the video's no problem, but if it's empty, it's showing the frame with a 404 error.
  3. Hi All, I think it's a synthax issue I have, I'm new to php coding as you can undoubtedly see from this code, but What I'm trying to do below is Check if get_post_meta( get_theID(), 'jv_item_video1', true ); has been filled in and if it has then show whats in the <iframe></iframe> Upto now the previous part would display a video from the users input, but if they didnt input into that specific field, it would show the frame with a 404 error inside, so I tried to add the if statement. Any help is much appreciated:) <?php $youtube_link = get_post_meta( get_the_ID(), 'jv_item_video1', true ); ?> <?php if (!empty($youtube_link)) { ?> <iframe width="300" height="200" src="<?php echo str_replace('watch?v=','embed/', $youtube_link); ?>" frameborder="0" allowfullscreen></iframe> </div> </div> <?php } ?> Previous - <?php $youtube_link = get_post_meta( get_the_ID(), 'jv_item_video1', true ); ?> <iframe width="300" height="200" src="<?php echo str_replace('watch?v=','embed/', $youtube_link); ?>" frameborder="0" allowfullscreen></iframe> </div> </div>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.