So I added BigFoot.js to Mean Green Nation. I run MGN on WordPress but the only way I saw to add it to my site was through the plugin. I’m not the biggest fan of WP shortcodes, and I like the way Markdown does footers and so I wanted to stick with that.

After some quick googlin’ I didn’t find an obvious how-to. I fiddled around with it for a half-hour and got it working. To fill the void until someone better comes along here you go:

How to Add Bigfoot.js without using WP-Bigfoot

  1. Grab the code from the project page
  2. Host it in your themes folder. Ex: YourKewlTheme/js/bigfoot/
  3. Edit your theme’s functions like in the example below.
  4. Enjoy!
<code>

<?php
/**
 * Proper way to enqueue scripts and styles
 */
function your_theme_add_bigfootscripts_yo() {
    wp_enqueue_script( 'bigfoot.js', get_stylesheet_directory_uri() . '/js/bigfoot/bigfoot.js', array('jquery'), false, false );
    wp_enqueue_style( 'bigfoot-default.css', get_stylesheet_directory_uri() . '/js/bigfoot/bigfoot-default.css' );
}

add_action( 'wp_enqueue_scripts', 'your_theme_add_bigfootscripts_yo' );

function yourtheme_add_head() { ?>
    <!-- Your HTML goes here -->
    <script type="text/javascript">
    jQuery.bigfoot();
</script>
<?php }
add_action( 'wp_head', 'yourtheme_add_head' );

?>
</code>

Notes: You have to use jQuery.bigfoot because wordpress has the noConflict mode on.

This was originally published here