To achieve this step, you must first find the id of the directory to be blocked. How can you view the wordpress category id? There are two methods:
View the category ID in the wordpress background
First, go to the wordpress category directory and place the cursor to the right-side category name or the edit button under the name. Then, the browser's status bar (lower left corner) will display the url address, similar to the following address:
Keep the mouse cursor over the product center category name, and view the browser status bar display information. In the browser status bar display information, the number "1" in tag_ID = 1 marked by the red line is the ID value of the classification.
After obtaining the required category ID, how can I disable the display of articles under the specified category on the wordpress homepage?
The wordpress homepage does not display the specified category. Method 1:
Normally, this code is used to call the list of the latest articles cyclically on the homepage of the topic.
Therefore, if you do not want to display an article of a category on the homepage, you only need to add a sentence under this Code.
Change the number in in_category ('1') to the ID of the category you do not want to display.
The wordpress homepage does not display the specified category. Method 2:
Create a folder in the root directory. For example, if my blog needs to block the IT directory, name the folder IT and display IT on the website http://seoxuexi.org/it. Then upload the same program in the folder, including the template.
In this way, your article updated on the it template will not be displayed on the homepage. The principle is very simple, because the two are not using the same program.
Disadvantages of this method: It is troublesome. If the template is changed, it needs to be modified simultaneously on both sides.
These two methods are indeed useful for my own experiments. You may wish to give it a try. Below are some of the articles I have shared with you on the Internet, but I have never tried them. I would like to share them with you:
The wordpress homepage does not display the specified topic category. Method 3: