Archived topic
Bigfoot.js works in Customizer but not on live site
4 replies · Started by jbpyn on September 27, 2017
I'm having a strange problem. I have setup the child theme, added the Bigfoot file accordingly and ammended the functions file with this:
add_action( 'wp_enqueue_scripts', 'tu_enqueue_bigfootjs' );
function tu_enqueue_bigfootjs() {
wp_enqueue_script( 'bigfoot.js', get_stylesheet_directory_uri() . '/bigfoot/bigfoot.js', array('jquery'), false, false );
wp_enqueue_style( 'bigfoot-default.css', get_stylesheet_directory_uri() . '/bigfoot/bigfoot-default.css' );
}
add_action( 'wp_footer', 'tu_add_bigfootjs' );
function tu_add_bigfootjs() { ?>
<script type="text/javascript">
jQuery.bigfoot(
{
numberResetSelector: "article"
}
);
</script>
<?php }
When I open up the Customizer to preview the footnotes, they work perfectly. But once I test the live site, the script doesn't run so I'm left with ordinary footnotes. I can't get Piwik to track anything either, so I suspect the same problem is affecting both scripts?
Please help
Any caching plugins?
Can you link us to the site possibly?
Bingo, it was the Auto Optimizer caching plugin. Seems really obvious now. It shouldn't have been there anyway. Thanks for the tip off.
Glad we could help!