The wordpress homepage does not display the specified category of articles

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.