Site with issues - http://rheareview.com
I have a community news website built on wordpress (multisite). The task was to place a weather feed including current temp including nice weather condition icon.
I thought I found a solution with zweatherfeed http://www.zazar.net/developers/jquery/zweatherfeed/. I found after inserting the jquery weather... my menu doesn't display once it reaches the first responsive breakpoint which is browser width 768px.
I know it is the weatherfeed giving me issues. When I remove the feed from my header.php it works correctly. BTW, I have called the 'jquery.min.js' and 'jquery.zweatherfeed.min.js' from my header.php. Thanks in advance for any help.
Seamus...
I add the following to the bottom of my functions.php :
function newsplus_add_scripts() {
// Register the zweatherfeed script
wp_register_script(
'zweatherfeed', // The name for the script
get_template_directory_uri() . '/js/zweather/jquery.zweatherfeed.min.js', // Here
array( 'jquery' ),
'1.0.1',
false
);
wp_enqueue_script( 'zweatherfeed');
}
// Call our function for the 'wp_enqueue_scripts' hook
add_action( 'wp_enqueue_scripts', 'newsplus_add_scripts' );
function newsplus_add_script_config() {
if ( wp_script_is('zweatherfeed') ) { // check that the zweatherfeed script is printed
echo "<script> jQuery('#test').weatherfeed(['USTN0132']);</script>";
}
}
add_action( 'wp_head', 'newsplus_add_script_config', 20 );
It is now calling the zweather script, but it's not showing. I am actually using a child theme of the newsplus theme names 'newsplus-child'. Should I be using the functions.php in the child theme directory? It is currently empty.
shashinPrettyphoto
that might be causing the other JS errors, as it might halt the JS execution ..