When we use tags in wordpress to truncate an article, the content of the previous article is displayed on the homepage, category, tag, and archive pages, and in the Post) and Page, the label is ignored and the full text is displayed. WordPress
When we use When a tag truncates an article, the content of the article on the homepage, category, tag, and archive pages is displayed. In previous articles, while in Post and Page Label to display the full text.
This is of course reasonable. you cannot make the visitor stay in the abstract on your final article page.
However, topic developers often use a Page Template to list articles that meet the query conditions. For example, the following code returns all articles with a category ID of 3.
Reference content is as follows: |
However, in this article list, the the_content () function will always output the full text, whether or not you have used the more tag in the article. Because WordPress only knows that this is a Page and needs to display the full text, it does not intelligently decide whether to support the more tag based on whether query_posts () is used or a new WP_Query object is created.
P.S: Sorry, I did not find this problem until today after I have made such a long wordpress topic. I personally prefer the "plain text summarization list" method. in the past, when I needed to create a document list, I used to automatically intercept document characters. However, for a project in progress, the customer needs to output the full html text, and then manually insert the more tag to truncation.
For a long time of nonsense, the solution is actually simple. please refer to the code (via weblogtoolscollection ):
Reference content is as follows: |
Note: declare a global variable $ more before the_content () and set it to flase. If you want to return to the original status after the content is displayed, set the $ more variable to true later.
Address: http://paranimage.com/the-more-tag-on-a-wordpress-page/