Query Arguments - MurhafSousli/ngx-wordpress GitHub Wiki
Please check Official WP Query Arguments to create a custom query.
Here is an example of getting posts for a sidebar
- only 3 posts
- only posts from last month
- only posts from specific categories
- exclude the current post
- random order
- embedded (contains links for featured image and more), read more in Embedded Responses Chapter
{
categories: this.post.get('categories'),
per_page: 3,
_embed: true,
'filter[date_query]': {
column: 'post_date_gmt',
before: '1 month ago'
},
'filter[orderby]': 'rand',
'filter[post__not_in]': [this.post.id()]
}
Note
To use filter you need to install and activate rest-filter plugin (created by the official WP API team)