Skip to content
Advertisement

Get most recent posts from specific category

JavaScript

I am trying to get the 10 most recent posts from a category named ‘Webinar’. How can this be done? At the moment the code above works in showing 10 posts but not specific from the webinar category.

Advertisement

Answer

This list of arguments is what drives the data that is fetched from the database:

JavaScript

You ask for 10 posts, ordered by title in an ascending order. It seems you simply forgot to include the category in your search conditions. Try:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement