You don't need to introduce wordpress, an open-source product. what a famous product is. today I will introduce you to the article that calls a specific wordpress category separately. This function is also very practical in development.
You don't need to introduce wordpress, an open-source product. what a famous product is. today I will introduce you to the article that calls a specific wordpress category separately. This function is also very practical in development.
The call code is as follows:
- "Rel =" bookmark "title =" ">
45 of the red part is the ID of the classification, and 6 of the green part is the number of display articles.
Note: The above code should not be copied directly to the DW editor or other editors. copy the code to a text document First, remove the original attributes, and then go to the editor.
====================================== Excerpt from related articles ============== ======================================
It is already a simple event for WordPress to get all categories. we can use the "wp_list_categories ()" function, however, if we want to operate on each category, it will be a very difficult event.
After querying a lot of information, I finally found a function that can be used to solve this problem. The "get_categories ()" function returns an array of objects categories that match the query parameters, and "wp_list_categories () "functions are very similar.
Now let's use an example to explain this function.
The following code gets all the categories and displays the latest 10 articles under each category:
Cat_ID; // Get the latest 10 articles under the category query_posts ("showposts = 10 & cat = $ catid");?> "Title =" ">