Created
April 23, 2018 15:20
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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