2016-03-04 27 views
-1

如何通过传递字符串php.I打印wordpress中的内容我写了下面的代码,但它打印所有的内容,包括image.I希望它只打印特定文本。如何通过传递字符串来打印wordpress php中的内容

<?php 

$content = get_the_content('Read more'); 
print $content; 

?> 
+0

https://codex.wordpress.org/Function_Reference/get_the_content – C2486

回答

0

使用the_excerpt仅显示有更多

含量少
<?php $short_desc= get_the_excerpt(); 
    echo substr($short_desc,0,200);?> 
+0

我想先打印200个字的内容,我该怎么办。 – Mohit

+0

<?php $ short_desc = get_the_excerpt(); echo substr($ short_desc,0,200);?> –

+0

请使用此命令打印200字内容... –