12 12
发新话题
打印

[问题求助] 如何在摘要中显示一个导读图呢?

如何在摘要中显示一个导读图呢?

http://www.zhan2.com/
上面这个博客,每个新闻右边会有个导读图,文章里没有,请问这个是用什么插件实现的呢?谢谢

TOP

加了个字段,然后调用显示
怀念1997年的秋天 这里的天空是灰色的,每天坐着一个怀旧的流浪人BBpress

TOP

这个,不懂PHP

TOP

在写日志的下边有一个自定义字段,加一个字段就行
例如Image字段
值为1.jpg
然后在模板里边要显示的地方添加上
例如
    <?php while (have_posts()) : the_post(); ?>
      <?php
// this grabs the image filename
$values = get_post_custom_values("Image");
// this checks to see if an image file exists
        if (isset($values[0])) {                                                
?>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="" /></a>
      <?php } ?>
      <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php
// this is where title of the article gets printed         
          the_title(); ?>»</a>
<?php the_excerpt(); ?>
      <?php endwhile; ?>

[ 本帖最后由 hedy 于 2008-9-17 16:48 编辑 ]

TOP

收藏了
谢谢楼上分享
完美实惠wp空间       我的 简爱
WP群74015724

TOP

收藏!!!

TOP

谢谢,收下了
wordpress交流QQ群33865654,期待你的加入

TOP

顶一下4楼的

TOP

谢谢,非常感谢。

TOP

代码加到哪啊?

TOP

 12 12
发新话题