php – How to limit number of posts in the certain category and exclude the oldest post automatically


I would like to have a php code which will exclude the oldest post from the certain category of certain taxonomy if total number of posts in this category (in the time of adding a new post) greater than X.

E.g. I have taxonomy ‘post_importance’ and category in it with terms ‘featured’. I already have 3 posts in category ‘featured’ and I am adding the fourth one. I want that after that the oldest post in category would be excluded from it. How to do it (sorry I have no expertise in php whatsoever, just html/css) 🙁


alexschneider 3 weeks 2023-02-27T23:53:47-05:00 0 Answers 0 views 0

Leave an answer