Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
I’ve read several posts about this request.
I need to show the oldest posts at the top in the block Blog Post under “LA RIVISTA” here (now it is showing the newest).
My Blog Post block has 2 columns and show only 6 posts.
I tried adding this function:
add_filter('avia_blog_post_query', 'avia_modify_post_grid_query_asc');
function avia_modify_post_grid_query_asc( $query ) {
$query['orderby'] = 'date';
$query['order'] = 'ASC';
return $query;
}
but nothing changed. Can you please help me?
Hey Nicola,
Thank you for the inquiry.
Try to replace the filter with the following code.
add_filter('avia_post_slide_query', 'avf_post_slide_query_mod');
function avf_post_slide_query_mod( $query ) {
$query['order'] = 'ASC';
return $query;
}
The orderby parameter is already set to “date” by default, so we don’t have to specify it.
Best regards,
Ismael