WordPress有摘要顯示摘要 沒摘要自動截取一段正文的內容作為摘要,實現方法如下:

 <?php if (has_excerpt()) {  
                echo $description = get_the_excerpt(); 
				//When there is a summary, display the summary entered when entering the article 
            }else {  
                echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 170,"……"); 
				//Automatically truncate a paragraph of the main text as a summary when no summary is entered 
            } 
			?>