-
AuthorPosts
-
March 10, 2017 at 12:08 pm #758840
Hi Team,
is there a way to sort Magazine Items in alphabetical order?
Maybe function.php?Thank you and regards
MikeMarch 10, 2017 at 12:52 pm #758856put this to functions.php of your child-theme:
if(!function_exists('avia_custom_query_extension')) { function avia_custom_query_extension($query, $params) { global $avia_config; if(!empty($avia_config['avia_custom_query_options']['order'])) { $query['order'] = $avia_config['avia_custom_query_options']['order']; } if(!empty($avia_config['avia_custom_query_options']['orderby'])) { $query['orderby'] = $avia_config['avia_custom_query_options']['orderby']; } unset($avia_config['avia_custom_query_options']); return $query; } add_filter('avia_masonry_entries_query', 'avia_custom_query_extension', 10, 2); add_filter('avia_post_grid_query', 'avia_custom_query_extension', 10, 2); add_filter('avia_post_slide_query', 'avia_custom_query_extension', 10, 2); add_filter('avia_blog_post_query', 'avia_custom_query_extension', 10, 2); add_filter('avf_magazine_entries_query', 'avia_custom_query_extension', 10, 2); add_filter('avf_template_builder_shortcode_elements','avia_custom_query_options', 10, 1); function avia_custom_query_options($elements) { $allowed_elements = array('av_blog','av_masonry_entries','av_postslider','av_portfolio','av_magazine'); if(isset($_POST['params']['allowed']) && in_array($_POST['params']['allowed'], $allowed_elements)) { $elements[] = array( "name" => __("Custom Query Orderby",'avia_framework' ), "desc" => __("Set a custom query orderby value",'avia_framework' ), "id" => "orderby", "type" => "select", "std" => "", "subtype" => array( __('Default Order', 'avia_framework' ) =>'', __('Title', 'avia_framework' ) =>'title', __('Random', 'avia_framework' ) =>'rand', __('Date', 'avia_framework' ) =>'date', __('Author', 'avia_framework' ) =>'author', __('Name (Post Slug)', 'avia_framework' ) =>'name', __('Modified', 'avia_framework' ) =>'modified', __('Comment Count', 'avia_framework' ) =>'comment_count', __('Page Order', 'avia_framework' ) =>'menu_order') ); $elements[] = array( "name" => __("Custom Query Order",'avia_framework' ), "desc" => __("Set a custom query order",'avia_framework' ), "id" => "order", "type" => "select", "std" => "", "subtype" => array( __('Default Order', 'avia_framework' ) =>'', __('Ascending Order', 'avia_framework' ) =>'ASC', __('Descending Order', 'avia_framework' ) =>'DESC')); } return $elements; } add_filter('avf_template_builder_shortcode_meta', 'avia_custom_query_add_query_params_to_config', 10, 4); function avia_custom_query_add_query_params_to_config($meta, $atts, $content, $shortcodename) { global $avia_config; if(empty($avia_config['avia_custom_query_options'])) $avia_config['avia_custom_query_options'] = array(); if(!empty($atts['order'])) { $avia_config['avia_custom_query_options']['order'] = $atts['order']; } if(!empty($atts['orderby'])) { $avia_config['avia_custom_query_options']['orderby'] = $atts['orderby']; } return $meta; } }
than you got extra options in the gallery dialogs
March 10, 2017 at 12:56 pm #758860you can find here http://kriesi.at/documentation/enfold/code-snippets/ some code snippets to influence sort options globaly. But this above you can decide eachtime you generate a new alb element.
March 10, 2017 at 1:03 pm #758864Thank you Guenni007, that’s it!
Have a nice Weekend!Best regards
MikeMarch 10, 2017 at 2:14 pm #758894by the way if you want a custom Sorting – use page order an the plugin “intuitive custom post order” –
after activation you can sort the page order by drag & drop in page/post/portfolio listing of dashboardMarch 10, 2017 at 7:08 pm #759086Thank you Guenni007 :)
February 21, 2018 at 9:37 pm #915732Is there a way to do this through quick CSS rather than editing the PHP file in a child theme?
February 22, 2018 at 4:41 am #915857November 16, 2018 at 11:11 pm #1034623Hi,
I have used this reordering plugin but it does not allow to sort the post within the magazine. Any idea?On this page you can see my magazines. The order of the posts within the magazines do not change when using the plugin.
Thanks
MarcoNovember 20, 2018 at 4:22 pm #1035646Hi Marco,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaNovember 21, 2018 at 1:00 pm #1036033Hi Victoria,
SireDetails attached below
November 25, 2018 at 5:36 am #1037343any luck with this ticket???
November 25, 2018 at 8:26 pm #1037442Hi,
Please try now, I have added a shorting option.
Best regards,
BasilisNovember 29, 2018 at 3:14 am #1038788Hi Basilis,
Thanks for your help. Can you please let me know where you have added this sorting option?Thanks,
MarcoDecember 4, 2018 at 12:38 pm #1040693Hi,
@marcoabis81: I can’t find this filter in your functions.php file anywhere.// https://kriesi.at/support/topic/sort-magazine-items-in-alphabetical-order/#post-758856
Where did you add it ?
Best regards,
IsmaelDecember 11, 2018 at 1:32 am #1043477Hi Ismael,
I do not want to sort them by alphabetical order. I would like to have a custom order.Can you help?
Regards,
MarcoDecember 12, 2018 at 2:56 pm #1044354Hi Marco,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaJune 4, 2019 at 3:57 pm #1107154The code snippet works great,but there is one issue. If you use the magazine element with ‘Display Tabs for each category selected above?’ – when you click on the tab on the front end, the tab will not be sorted as specified in the sorting options. How to fix that?
June 10, 2019 at 5:46 am #1108739 -
AuthorPosts
- The topic ‘Sort Magazine Items in alphabetical order?’ is closed to new replies.