<div class="wpex-recent-posts-content clr">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a><p>
<?php
$content = the_content();
echo substr($content,0,100);
?>
</p>
</div>
这里echo substr($content,0,100);
无法将内容从0裁剪到100。该位置位于my_theme/functions/widgets/widget-portfolio-posts-thumbs.php
试试这个:
$content = get_the_content();
$content = strip_tags($content);
echo substr($content, 0, 100);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句