【发布时间】:2012-03-25 02:34:15
【问题描述】:
我正在 pizzli.com/darrenwp 上工作。我使用 Jquery/Jquery UI 和一个名为 youtubeid 的自定义字段创建了一个特色内容滑块。如果 youtubeid 自定义字段包含 YouTube ID 并且如果不包含我想要显示帖子的特色图片,我想要做的是显示 YouTube 视频。我已经在帖子页面上进行了这项工作,但没有使用 Jquery 滑块。任何支持将不胜感激。这是我尝试使用的代码: ">">
<!-- 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>
【问题讨论】:
标签: php html css wordpress wordpress-theming