我有下面的条件标签,一个朋友帮我做的。。。
目前正在进行。。
1) 如果有一张特色图片,就显示出来。
2) 如果附加图像显示附加图像链接中的特色图像。。
会有第三个吗?
3) 如果元数据只是一个文本输入字段rw\\u post-vimeo,那么它就是一个vimeo链接。。get\\u post\\u meta($post->ID,\'rw\\u post-vimeo\',true)
我在下面做了一次尝试,但它打破了它,这可能吗?
<ul id="post-list">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$featured = get_post_meta($post->ID,\'_thumbnail_id\',true);
$attachments = get_children( \'post_type=attachment&orderby=menu_order&exclude=\'.$featured.\'&post_mime_type=image&post_parent=\'.$post->ID );
?>
<li class="post">
<span class="entry-published">
<time datetime="<?php the_time(\'Y-m-d\')?>"><?php the_time(\'F jS, Y\') ?></time>
</span>
<?php if ( !empty($attachments) ) : ?>
<div class="entry-specific-content">
<a href="<?php echo get_bloginfo(\'template_directory\').\'/gallery.php?id=\'.$post->ID; ?>">
<?php if (has_post_thumbnail()): the_post_thumbnail();else: $first_img = wp_get_attachment_image_src($attachments[0]->ID, \'thumbnail-size\'); ?>
<img src="<?php echo $first_img[0]; ?>" width="<?php echo $first_img[1]; ?>" height="<?php echo $first_img[2]; ?>" />
<?php endif; ?>
</a>
</div>
<div class="yes-gallery">
<a href="<?php echo get_bloginfo(\'template_directory\').\'/gallery.php?id=\'.$post->ID; ?>">See Rest Of Images</a>
</div>
<?php else: ?>
<div class="entry-specific-content">
<?php the_post_thumbnail(); ?>
</div>
<div class="no-gallery"></div>
<?php else: ?>
<div class="entry-specific-content">
<?php echo do_shortcode(\'[iframe_loader src="http://player.vimeo.com/video/\'. get_post_meta($post->ID, \'rw_post-vimeo\',true) .\'?title=0&byline=0&portrait=0&color=ffffff&autoplay=1" width="640" height="360" frameborder="0""]\');?>
</div>
<div class="no-gallery"></div>
<?php endif; ?>
<h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
</li>
<?php endwhile; endif; ?>
</ul>
这是可能的还是不可能的,另一种方法?感谢您的帮助:)