【发布时间】:2015-05-23 13:15:08
【问题描述】:
在最新的帖子循环中,当我尝试回显 the_excerpt() 函数时,它会在摘录内容的分箱中添加 +-*。提前致谢。
<?php if ( have_posts() ) : while (have_posts()) : the_post(); ?>
<article class="media group">
<?php
// get the tag names of the current post.
$posttags = get_the_tags($post->ID);
foreach($posttags as $tag){
?>
<div class="meta meta--line">
<h4 class="is-basefont is-inline is-forceful"><a href="#" class="is-category "><?php echo $tag->name; ?></a></h4>
<a href="<?php echo get_permalink($post->ID); ?>#disqus_thread" class="comment-count count-comments fa fa-comment" data-disqus-url="#">
<?php echo $post->comment_count; ?>
</a>
</div>
<?php } //end of get psot tags loop. ?>
<?php $url = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); ?>
<div class="media__body">
<h2 class="size_3"><a href="<?php the_permalink(); ?>" sl-processed="1"><?php the_title(); ?></a></h2>
<div class="meta">
<?php echo ' By <a href="#">'.$author_name = get_userdata($post->post_author)->display_name.'</a>';?>
<?php echo ' On '. get_the_time('j, F Y g:i a ',$post->ID); ?></small>
</div>
<p><?php the_excerpt(); ?></p>
</div>
</article>
<?php endwhile; ?>
【问题讨论】:
-
你需要显示一些代码...
-
这是循环,当我在另一个地方使用它时它显示正常
标签: wordpress wordpress-theming