1
我在jQuery的「Superfish」下拉菜單(Wordpress)上工作。我使用最新版本的superfish和wordpress。問題是,快魚讓我的菜單看不見......我什麼也看不到我的菜單...WordPress上的jQuery Superfish菜單不顯示
的functions.php
//Register Superfish
///////////////////////////////////////////////////////////
add_action('wp_enqueue_scripts', 'superfish_libs');
function superfish_libs()
{
// Register each script, setting appropriate dependencies
wp_register_script('hoverintent', get_template_directory_uri() . '/superfish-js/hoverIntent.js');
wp_register_script('bgiframe', get_template_directory_uri() . '/superfish-js/jquery.bgiframe.min.js');
wp_register_script('superfish', get_template_directory_uri() . '/superfish-js/superfish.js', array('jquery', 'hoverintent', 'bgiframe'));
wp_register_script('supersubs', get_template_directory_uri() . '/superfish-js/supersubs.js', array('superfish'));
// Enqueue supersubs, we don't need to enqueue any others in this case, as the dependencies take care of it for us
wp_enqueue_script('supersubs');
// Register each style, setting appropriate dependencies
wp_register_style('superfishbase', get_template_directory_uri() . '/superfish-css/superfish.css');
wp_register_style('superfishvert', get_template_directory_uri() . '/superfish-css/superfish-vertical.css', array('superfishbase'));
wp_register_style('superfishnavbar', get_template_directory_uri() . '/superfish-css/superfish-navbar.css', array('superfishvert'));
// Enqueue superfishnavbar, we don't need to enqueue any others in this case either, as the dependencies take care of it
wp_enqueue_style('superfishnavbar');
}
//Register jQuery 1.1.3
///////////////////////////////////////////////////////////
wp_deregister_script('jquery');
if(!is_admin()) {
wp_register_script('jquery', get_template_directory_uri() . '/js/jquery-1.1.3.js');
wp_enqueue_script('jquery');
}
的header.php
<div id="wrapper-mainnav">
<div class="left"></div>
<div class="content">
<?php wp_nav_menu(array('theme_location' => 'mainnav', 'menu_class' => 'sf-menu')); ?>
</div>
<div class="right"></div>
<br class="clearer">
<div class="bottom"></div>
</div><!--wrapper-mainnav-->
請幫助,我無法找到故障...請告訴我,如果您需要更多信息...
只是儘量把腳本到頁腳,並確保您的菜單是存在的,之前的代碼顯示的罰款。和jQuery 1.1.3的歷史可以追溯到一開始。 – teemo
我加了,但是我有同樣的問題。我updatet jquery:'wp_deregister_script('jquery'); if(!is_admin()){ wp_register_script('jquery','http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js'); wp_enqueue_script('jquery'); } '如果我刪除SFF菜單類,它的工作 – taito
你想改變wordpress菜單的後端? – teemo