2016-03-04 21 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字內容... –

相關問題