0
是Jet - 響應式Megamenu與Wordpress兼容? 如果不是我怎麼能使它與Wordpress菜單系統一起工作?如何使Jet - 響應式Megamenu與Wordpress兼容?
是Jet - 響應式Megamenu與Wordpress兼容? 如果不是我怎麼能使它與Wordpress菜單系統一起工作?如何使Jet - 響應式Megamenu與Wordpress兼容?
下面你有讓菜單在Wordpress上工作的代碼。它在Wordpress 4.3上測試,但我認爲它可以在Wordpress 3.2+上工作(我不是100%確定的)。
<?php
/* Put this script inside header.php in Wordpress theme folder */
class My_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl(&$output, $depth = 0, $args = array()) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"dropdown\">\n";
}
}
$menuSettings = array(
'container' => 'div',
'menu_class' => 'jetmenu yellow', //change this to whatever classes you need for your menu
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'items_wrap' => '<ul id="%1$s" class="%2$s dropdown">%3$s</ul>',
'depth' => 3, //the number of submenus + 1
'walker' => new My_Walker_Nav_Menu()
);
wp_nav_menu($menuSettings); //This script displays the menu. Please put it where you want it to display the menu.
?>
我希望這可以解決某人的問題。