1
我有下面的代码段,其输出一个长的文章:邮政和摘录
<?php the_content(); ?>
我试图只显示文章(第一29个字)的摘录,剥离出HTML并在最后添加“......更多”。
<?php substr(the_content, 29) ?>
我试过这个,但它对长度没有影响。
任何帮助?谢谢
我有下面的代码段,其输出一个长的文章:邮政和摘录
<?php the_content(); ?>
我试图只显示文章(第一29个字)的摘录,剥离出HTML并在最后添加“......更多”。
<?php substr(the_content, 29) ?>
我试过这个,但它对长度没有影响。
任何帮助?谢谢
你需要的是the_excerpt
<?php the_excerpt(); ?> //and you could check the doc how to set the length.
<?php echo substr(get_the_content(), 0, 29); ?>
the_content打印的内容和get_the_content将得到的。
你需要的是the_ + 1 –
这么简单,谢谢! – user1444027