Sometimes we want to get several articles under the wp classification, which is actually very simple, that is, the following code: & amp; lt; div & amp; gt; & amp; nbsp; & amp; nbsp; & amp; lt ;? Phpquery_posts (& quot; showposts = 1
Sometimes we want to get several articles under the wp classification, which is actually very simple, that is, the following code:
"Rel =" bookmark ">
A little explanation:
Query_posts: query document functions
Showposts = 10: displays the number of articles. Here are 10.
Orderby = date: this is a sorting rule, indicating to sort by time
Of course, you can also consider sorting other parameters:
- Orderby = author
- Orderby = date
- Orderby = category
- Orderby = title
- Orderby = modified
- Orderby = modified
- Orderby = menu_order
- Orderby = parent
- Orderby = ID
Order = DESC: ASC indicates ascending, DESC indicates descending