Plugin Author
Brecht
(@brechtvds)
Hi Mic,
To change the order you have to use some custom code at the moment. You’d have to add something like this to your theme’s functions.php file:
function wpupg_change_terms_order( $filter_terms_order, $grid ) {
if( $grid->slug() == 'your-grid-slug' ) {
$filter_terms_order = array( '2016', '2015', '2014' );
}
return $filter_terms_order;
}
add_filter( 'wpupg_grid_cache_filter_isotope_term_order', 'wpupg_change_terms_order', 10, 2 );
Make sure to replace the grid and term slugs to whatever you’re using.
Hi,
thank you for your answer.
I’m not really sure about what my grid-slug is. I tried this:
function wpupg_change_terms_order( $filter_terms_order, $grid ) {
if( $grid->slug() == 'grid1' ) {
$filter_terms_order = array( 'Alles', '2016', '2015', '2014' );
}
return $filter_terms_order;
}
add_filter( 'wpupg_grid_cache_filter_isotope_term_order', 'wpupg_change_terms_order', 10, 2 );
I named my grid “grid1”. Is this the slug? I also tried the filter-id.
But nothing has changed.
Can you please help me?
mic
Plugin Author
Brecht
(@brechtvds)
Hi again,
You should use what’s used in the shortcode. So if your shortcode is [wpupg-grid id=”grid1″] then “grid1” is correct.
Can you give me a link to your grid so I can take a look?
Brecht
Hi Brecht,
here is the link: grid.
The name of the grid is grid1, the shortcodes are
Grid
[wpupg-grid id=”776″]
Filter
[wpupg-filter id=”776″]
mic
Plugin Author
Brecht
(@brechtvds)
Then you need to check for $grid->slug() == ‘776’
Brecht