Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created August 31, 2015 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudeRosario/bbb60d394332cdb2a9b3 to your computer and use it in GitHub Desktop.
Save JudeRosario/bbb60d394332cdb2a9b3 to your computer and use it in GitHub Desktop.
Events + Reverse Order
add_action('wp_footer', 'custom_JS') ;
function custom_JS() {
echo <<<JS
<script type="text/javascript">
jQuery(document).ready(function () {
if(window.location.href.indexOf("/events/") > -1) {
ul = jQuery('#content');
ul.children().each(function(i,li){ul.prepend(li)})
}
});
</script>
JS;
}
@JudeRosario
Copy link
Author

Just copy/paste the code into the functions.php file of your child theme or a site specific plugin if you use one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment