How to Exclude Category Post From Homepage

If you want to exclude some specific categories posts from home page, then this tutorial for you. Pay attention in this tutorial as I am going to explain how to exclude category post from the homepage.
This is a simple code, which will exclude the categories posts to display on your home page. You need to pass those category ids in the below function, which you does not want to display.

Open functions.php file from your current theme folder and copy paste below code at the end of the file and save. In the below, code 9, 14, and 5 are the category ids. All the posts which belong from these categories will not display on the homepage, but it will be displayed on the category and search page.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , , ,