I'm working on pizzli.com/darrenwp. I've created a featured content slider using Jquery/Jquery UI and a custom field called youtubeid. What I am trying to do is display the YouTube Video if the youtubeid custom field contains a YouTube ID and if it doesn't I want to display the Post's featured image. I've got this working on the post pages, but not with the Jquery slider. Any support would be highly appreciated. Here's the code that I am trying to use: ">">
<!-- First Content -->
<?php $x=0 ?>
<?php query_posts("showposts=4&category_name=Popular News"); $i = 1; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $x++ ?>
<?php $youtubeid = get_post_meta($post->ID, "youtubeid", true); ?>
<div id="fragment-<?php echo ($x);?>" class="ui-tabs-panel" style="">
<?php if($youtubeid !=='') { ?>
<?php echo "<iframe width='400' height='250' src='http://www.youtube.com/embed/'"?><?php echo ($youtubeid) ?> <?php echo "frameborder='0' allowfullscreen></iframe>"?>
<?php } ?>
<div class="info" >
</div>
<h2><a class="title" rel="bookmark" href="<?php the_permalink() ?>"><?php the_title();?> </a></h2>
<p><?php the_excerpt(); ?><a class="title" rel="bookmark" href="<?php the_permalink() ?>">Read more</a></p>
<?php echo ($youtubeid); ?>
</div>
<?php endwhile; ?>
</div>