Skip to content

Instantly share code, notes, and snippets.

@rali14
Created June 9, 2015 02:18
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 rali14/eb93ce010575437d08f3 to your computer and use it in GitHub Desktop.
Save rali14/eb93ce010575437d08f3 to your computer and use it in GitHub Desktop.
force autolocation on homepage only
function listify_custom_autolocation() {
if ( ! ( is_front_page() ) ) {
return;
}
?>
<script>
jQuery(document).ready(function() {
var locate = jQuery( '.locate-me' );
locate.trigger( 'click' );
});
</script>
<?php
}
add_action( 'wp_footer', 'listify_custom_autolocation', 9999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment