Tagged: , , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #594287

    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 ?

    #594827

    Hi limentani,

    Is it working they way you intended? If so I don’t see any problem with your code.

    Thanks,
    Rikard

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.