Hi Martin,
Yes I'd found the load in footer option! :)
I call my script global-js
:
function pwc_theme_name_scripts() {
wp_enqueue_script( 'global-js', get_template_directory_uri() . '/assets/js/build/production.min.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'pwc_theme_name_scripts', 0 );
When I load a page with rotating tweets on, I get the following error:
Uncaught TypeError: undefined is not a function rotating_tweet.js:48(anonymous function) rotating_tweet.js:48eb.extend.each production.min.js:1eb.fn.eb.each production.min.js:1(anonymous function) rotating_tweet.js:5j jquery.js:2k.fireWith jquery.js:2m.extend.ready jquery.js:2J
This must be because of jquery being loaded in the header, along with jquery-migrate.min.js:
<script type='text/javascript' src='http://dpa.dev/wp-includes/js/jquery/jquery.js'></script>
<script type='text/javascript' src='http://dpa.dev/wp-includes/js/jquery/jquery-migrate.min.js'></script>
I can't quite work out where to apply your code, this is 1839 to 1853 for me:
foreach($option as $stringname => $contents) {
$ageindays = (time()-$contents['datetime'])/60/60/24;
if($ageindays > $targetageindays) unset($option[$stringname]);
};
$numberidentities = count($option);
if(WP_DEBUG) echo "<!-- There are now ".$numberidentities." identities cached -->";
update_option($optionname,$option);
}
Thanks for the help.