Tagged: enfold, magazine, sort order, tab
Kriesi Team,
Thank you for your fine work that makes us look good!
Using your instruction – on the Magazine element:
I found the sort to work well for “ALL ITEMS” (todos in Spanish). However, when switching to the tab view (example himnos) the sort is lost. How might I add the same sort to all views no matter which tab is displaying?
Example (URL in Private Content)
Hey Julie!
Thank you for using Enfold.
Please remove the modification or the extra options then use this in the functions.php file:
add_filter('avf_magazine_entries_query','avf_magazine_entries_query_mod', 10, 2);
function avf_magazine_entries_query_mod($query, $params) {
$query['orderby'] = 'title';
$query['order'] = 'ASC';
return $query;
}
Cheers!
Ismael
Hi Ismael,
Thanks for the response. However, I get an error now.
Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /nas/content/staging/ilcristo/wp-content/themes/enfold-child/functions.php on line 3
The site doesn’t display because of this.
Ah ha! I figured it out on my own :) The single quotes translated to entities when copying and pasting the code. Replacing those gave me good results. Thank you so much for this solution.
Magazine posts are now sorted by title in ascending order no matter which filter is chosen. Yes!