为什么一个人不能像ID一样获得标题和大多数其他元素的摘录。
例如,获取\\u摘录(ID)。我知道如何将其与$post->post\\u extract函数一起使用,但如果没有输入摘录,则不会返回部分内容,simple不会返回任何内容。
所以我要做的是,如果有摘录,就通过ID获取摘录,如果没有ID的摘录,但有一些内容,就获取一些内容。
人们会怎么做呢。
任何想法,
非凡的
编辑--
按要求循环源代码。
<?php $stories = get_posts(\'category_name=feedback&numberposts=4\');
foreach ($stories as $post) :
$title = $post->post_title;
$excerpt = get_the_excerpt_id($post->ID);
$thumb = get_the_post_thumbnail($post->ID,array(60, 60, true));?>
<div class="textstandard_white" style="font-size:14px; line-height:22px; padding-top:10px;"><b><a href="<?php echo get_permalink($post->ID);?>"><?php echo $title;?></a></b></div><div align="left" style="height:18px; width:82px; background:url(http://www.divethegap.com/update/z-images/structure/icons/stars.png) left top no-repeat;"><div id="stars<?php echo $post->ID;?>" align="left" style="height:18px; background:url(http://www.divethegap.com/update/z-images/structure/icons/stars_glow.png) left top no-repeat;">
</div>
</div>
<script type="text/javascript">
var width<?php echo $post->ID;?> = ((<?php
$Rating = get_post_meta($post->ID, "Rating", true);
echo $Rating;
?> * 20) + \'%\')
$(\'#stars<?php echo $post->ID;?>\').css(\'width\', width<?php echo $post->ID;?>);
</script><div class="textstandard_white" style="padding-top:6px; font-size:10px; color:#BBB; padding-bottom:10px; border-bottom:1px dotted #BBB; min-height:70px;"><div style="float:left; padding-right:6px; padding-bottom:6px;"><div style="background:#FFF; border:1px solid #FFF;
border-radius: 4px; -moz-border-radius: 4px ; -webkit-border-radius: 4px; padding:4px;"><a href="<?php echo get_permalink($post->ID);?>"><?php echo $thumb;?></a></div></div>
<?php echo $excerpt;?></div>
<?php endforeach;?>