WordPress Exclude Categories from Recent Posts Widget

By March 2, 2016Widget

Today I had to find a way to exclude posts from certain categories from showing up in the recent posts widget. I did a search and I stumbled across this discussion in the WordPress Forums.

I have found that pretty much everything you need with WordPress has been discussed and solved somewhere out in the Interwebs. Thankfully lawless shared his solution to this need. By adding the following code to your functions.php file, you can exclude categories by adding the category ID to the new Exclude Category(s) field.You can copy his code below and paste it into your functions.php file. I also packaged it up as a plugin which you can download and install manually. I will work on adding it to the WordPress repository shortly.

 

exclude-category-recent-posts

 

nhantam
VLandingPage

Freelancer Wordpess Developer Team

Leave a Reply

Captcha * Time limit is exhausted. Please reload CAPTCHA.