2012-06-08 45 views
1

我有下面的代码段,其输出一个长的文章:邮政和摘录

<?php the_content(); ?>

我试图只显示文章(第一29个字)的摘录,剥离出HTML并在最后添加“......更多”。

<?php substr(the_content, 29) ?> 

我试过这个,但它对长度没有影响。

任何帮助?谢谢

回答

2

你需要的是the_excerpt

<?php the_excerpt(); ?> //and you could check the doc how to set the length. 
+1

你需要的是the_ + 1 –

+0

这么简单,谢谢! – user1444027