Skip to content

Instantly share code, notes, and snippets.

@motorcitymobi
Created July 8, 2013 13:18
Show Gist options
  • Save motorcitymobi/5948707 to your computer and use it in GitHub Desktop.
Save motorcitymobi/5948707 to your computer and use it in GitHub Desktop.
Combining Zurb's Reveal with the Genesis Framework.
<?php
/*
Template Name: Modal (Foundation)
*/
add_action( 'genesis_after', 'mobile_do_reveal_demo' );
function mobile_do_reveal_demo() { ?>
<!-- Check for Zepto support, load jQuery if necessary -->
<script>
document.write('<script src=/js/vendor/'
+ ('__proto__' in {} ? 'zepto' : 'jquery')
+ '.js><\/script>');
</script>
<script>
jQuery(document).ready(function($) {
$(function(){
$(document).foundation();
})
});
</script>
<div id="myModal" class="reveal-modal">
<h3>Hello Modal</h3>
<a class="close-reveal-modal"><i class="icon-remove"></i></a>
</div>
<?php
}
add_action( 'genesis_after', 'mobile_do_modal_scripts' );
function mobile_do_modal_scripts() {
wp_enqueue_script( 'foundation-cloud' );
wp_enqueue_script( 'reveal-cloud' );
}
// do genesis
genesis();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment