Skip to content

Instantly share code, notes, and snippets.

@barryhughes
Created April 23, 2018 15:20
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 barryhughes/7113d5fe075d50d7899abb4615994aec to your computer and use it in GitHub Desktop.
Save barryhughes/7113d5fe075d50d7899abb4615994aec to your computer and use it in GitHub Desktop.
Modifies the layout mode used by photo view, such that events are clearly ordered into rows. May also need supporting CSS changes.
<?php
/**
* Adds some JS to photo view that instructs Isotope to use a different
* layout mode ("fitRows"), which some may feel offers a more chronologically
* accurate view of events.
*
* Supporting CSS changes may also be needed for the best possible result.
*/
add_action( 'wp_footer', function() {
if ( ! function_exists( 'tribe_is_photo' ) || ! tribe_is_photo() ) {
return;
}
echo '
<script>
jQuery( "#tribe-events-photo-events" ).isotope( { layoutMode: "fitRows" } );
</script>
';
}, 1000 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment