【发布时间】:2010-11-24 22:48:34
【问题描述】:
只是想知道是否有人可以帮助我解决以下问题。
在我网站的主页上,我显示了 3 篇来自我已集成到网站中的 Wordpress 博客网站的博客文章;因此,我使索引页动态化,并添加了以下内容:
<div id="from-blog">
<h2>Latest Blog Posts</h2>
<ul>
<?php while (have_posts()): the_post(); ?>
<li class="latest-entry-front">
<span class="post-date">
<span class="date-text">
<span class="month"><?php the_time('M') ?></span><br/>
<span class="day"><?php the_time('d') ?></span>
</span>
</span>
<a href="<?php the_permalink(); ?>" title="Read full post"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
</div>
这里的问题是帖子显示的是完整的博客标题,看起来很乱,这是一个很长的博客帖子标题;因此有没有办法可以修剪它以仅显示最大数量的字符,然后在它之后 [...] 或 ...
非常感谢任何帮助!
【问题讨论】: