WordPress summary display method
WordPress has a summary display column in the background. If it is not displayed, it needs to be set. As shown in the figure:
#When the content is displayed on the list page, the summary is usually displayed if there is a summary, and the first part of the text of the article is intercepted if there is no summary. The code is as follows:
post_content),0,400,'......[阅读全文]');?>
The "400" in the code refers to the display characters, two characters are equal to one Chinese character.
Related recommendations: "WordPress Tutorial"
Sometimes, the summary is too long and does not look good when displayed. You can add this paragraph to the functions.php file. Code to control the number of words displayed in the summary.
*控制摘要字数*/ function new_excerpt_length($length) { return 150; } add_filter("excerpt_length", "new_excerpt_length");
The default ending of the summary is [...], which is not in line with the reading habits of Chinese people. You can customize the ending of the summary and insert this code in functions.php
function new_excerpt_more($more) { global $post; return " ID) . "">阅读更多"; } add_filter("excerpt_more", "new_excerpt_more");
Add a read more link at the end of the article summary, which looks more in line with the user's reading habits. Read more can be changed to the content you want.
Summary: If you want to hide the article summary, cancel the "Abstract" in the display item in the background.
The above is the detailed content of How to stop WordPress from displaying article excerpts. For more information, please follow other related articles on the PHP Chinese website!