存在问题的站点-http://rheareview.com
我有一个基于wordpress(多站点)的社区新闻网站。任务是放置一个包含当前温度的天气提要,包括“天气状况良好”图标。
我想我找到了zweatherfeed的解决方案http://www.zazar.net/developers/jquery/zweatherfeed/. 我在插入jquery天气后发现。。。我的菜单在到达第一个响应断点(浏览器宽度768px)时不会显示。
我知道是weatherfeed给我带来了问题。当我从标题中删除提要时。php它工作正常。顺便说一句,我称之为“jquery”。min.js和jquery。zweatherfeed。我的标题中的min.js。php。提前感谢您的帮助。
谢默斯。。。
我在函数的底部添加了以下内容。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 );
它现在正在调用zweather脚本,但没有显示。我实际上使用的是newsplus主题的子主题名为“newsplus child”。我应该使用这些函数吗。子主题目录中的php?它当前为空。