Hello,
i would to create a filter for filtering the posts on the component “Posts grid” in the homepage only.
function custom_post_grid_query( $query, $params ) {
$query['order'] = 'DESC';
$query['year'] = date('Y');
$query['monthnum'] = date('m');
return $query;
}
add_filter('avia_post_grid_query', 'custom_post_grid_query',10,2);
Is this the better way ?