Hi! Enfold is amazing.
Need help: I want to be able to sort my Portfolio items on a page not only with ID:s but with Dates or preferably Random.
Add following code to the bottom of functions.php:
function custom_post_grid_query( $query, $params ) {
$query['orderby'] = 'date';
$query['order'] = 'DESC';
return $query;
}
add_filter( 'avia_post_grid_query', 'custom_post_grid_query', 10, 2);
For an ascending order use ASC instead of DESC.. For a random order use:
function custom_post_grid_query( $query, $params ) {
$query['orderby'] = 'rand';
return $query;
}
add_filter( 'avia_post_grid_query', 'custom_post_grid_query', 10, 2);
Dude, i Just put on functions.php (enfold theme folder)
function custom_post_grid_query( $query, $params ) {
$query = ‘date’;
$query = ‘DESC’;
return $query;
}
add_filter( ‘avia_post_grid_query’, ‘custom_post_grid_query’, 10, 2);
But it’s not showing the last portfolio on home page, you can see on:
The portfolio page is: (see that there is 3 newer itens)