Is it possible to change the order of the categories in the filter dropdown on the calendar? I changed the category IDs in the database to represent the order I’d like, thinking that would affect the order but, no luck.
Hi Trevis, any available options for the calendar are already shown in the calendar settings area in your WP dashboard. Note that the calendar does not use templates so changing the default behavior isn’t as easy as changing something within a template for a page in Event Espresso 3.
You could check with an Event Espresso professional here for help on adding this new feature for adjusting the order of the options in the dropdown menu:
There’s another way to reorder those. Since the Calendar page is loading the jQuery library, you can add a little jQuery to the bottom of the calendar page. Here’s a little example you can use, which shows how to move the 3rd option up to right after the Select All option:
Thanks for the suggestion, Josh. When I add the jQuery example to the bottom of the espresso-calendar.php file and reload the site, it returns a blank, white page. Is there a more specific place I should add that?
Yes, you should definetly not add this to the calendar plugin code. Instead, you can add it to your theme’s functions.php file or into a site specific snippets plugin.
Here’s a more verbose example that shows how to add the custom script via a custom function:
function eecal_print_my_inline_script() {
if( is_page('calendar' ) ){ //substitute 'calendar' with your calendar page's slug
if ( wp_script_is( 'jquery', 'done' ) ) {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
var options = $('.ee-category-select option');
$( options[ 4 ] ).insertAfter( $(options[ 1 ] ) );
// add more here
});
</script>
<?php
}
}
}
add_action( 'wp_footer', 'eecal_print_my_inline_script' );
Thank you so much, Josh—that works perfectly. I greatly appreciate the help!
Viewing 6 reply threads
The support post ‘EE3 Calendar Add-On: Reorder Category Filter list’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.