• aspiranthawk

    (@aspiranthawk)


    我要实现的功能为:

    在不同分类目录有不同的一篇文章置顶并全文显示,第一步用 wp-sticky 插件已经实现;
    目前第二步要把这些置顶文章在分类目录中全文显示,

    <div>
    <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <div class="meta"><span class="tag">分类:<?php the_category(',') ?> | 作者:<?php the_author() ?> | 发表于<?php the_time(__('Y/m/d', 'kubrick')) ?></span><span class="time"> <?php comments_popup_link(__('没有评论 '), __('1条评论'), __('%条评论')); ?> <?php if(function_exists('the_views')) { the_views(); } ?> <?php edit_post_link(__('Edit This')); ?></span>
    </div>
    <div class="excerptbox">
    <?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 350,"..."); ?>
    </div>

    目前已知道 把<?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 350,"..."); ?>

    替换为

    <?php if ( ??? ) { the_content(); } else { echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 200,"..."); } ?>

    但是不知道怎么判断分类目录中的第一篇文章列表的,请教,谢谢~~~

  • 话题 ‘请问怎么判断分类目录中的文章列表中第一篇文章’不再接受新回复。