wordpress API

wpordpress截取字符串wp_trim_words

日期:2014-10-04 阅读:1535

dmandwp系统 - wordpress系统和DM系统区块建站>>

http://codex.wordpress.org/Function_Reference/wp_trim_words  -   in wp-includes/formatting.php

还可以增加 更多的链接。
<?php

$content = get_the_content();
$trimmed_content = wp_trim_words( $content, 40, '<a href="'. get_permalink() .'"> ...Read More</a>' );
echo $trimmed_content;

?>

http://codex.wordpress.org/Function_Reference/get_the_content -  in wp-includes/post-template.php.
Retrieve the post content. (Must be used in a Loop) 

<<点击返回