Comments 10alleganps started the conversationDecember 10, 2021 at 7:06pmHow would I reorder the Calendar dropdown list as shown in the attached image? Preferably, I would like the list to sort alphabetically.Thank you, and have a great weekend. 10alleganps repliedMarch 1, 2022 at 3:09pmI'm just following up on this post to see if there is a solution. Thank you for your help! 877Zhivko repliedMarch 1, 2022 at 7:51pmHi,Try following:Place the script below in your theme or child-theme functions.php file: // STEC MOD reorder calendars menu alphabeticallyadd_action('wp_footer', function () { if (false === wp_script_is('stec-js')) { return; } ?> <script type="text/javascript"> (function($) { $(function() { $.stecExtend(function(m, events) { const $content = m.$instance.$top.find('.stec-top-menu-filter-by-calendar') .find('li[data-calid]'); $content.sort(function(a, b) { const aTitle = $(a).find('span').text(); const bTitle = $(b).find('span').text(); if (aTitle < bTitle) { return -1; } if (aTitle > bTitle) { return 1; } return 0; }); m.$instance.$top.find('.stec-select-all').after($content); }, 'onAddToEventsPool'); }); })(window.jQuery); </script><?php}); Stachethemes Developer 10alleganps repliedMarch 2, 2022 at 12:50pmWorked perfectly, as always. Thank you!1 Like Sign in to reply ...
How would I reorder the Calendar dropdown list as shown in the attached image? Preferably, I would like the list to sort alphabetically.
Thank you, and have a great weekend.
I'm just following up on this post to see if there is a solution. Thank you for your help!
Hi,
Try following:
Place the script below in your theme or child-theme functions.php file:
Stachethemes Developer
Worked perfectly, as always. Thank you!