2015-11-04 46 views
0

我對創世記框架很新,我不知道是否有可能在標題中創建兩個菜單位置? 它應該是這樣的:WordPress的創世紀 - 在標題(主要+輔助)中創建兩個菜單位置

主菜單---(標誌)---二級菜單

主菜單應靠左對齊,並在二級菜單應右對齊。 我的想法只是將兩個菜單位置添加到我的childtheme,「標題右」和「標題左」,並將菜單分配給他們。 我是新來的過濾器和掛鉤,但據我所知,這應該不是那麼多麻煩。或者我錯了? 任何幫助,將不勝感激!我期待着你的回答。

回答

1

此代碼放在兒童主題function.php文件:

?php 
//do not copy the opening php tag above 

/** 
* Swap Primary Nav to Header Right and Remove Wrap 
* 
* @package Swap Primary Nav 
* @author Neil Gee 
* @link http://coolestguidesontheplanet.com/switching-primary-menu-genesis-theme-header-right/ 
* @copyright (c) 2014, Neil Gee 
*/ 
remove_action('genesis_after_header','genesis_do_nav') ; 
add_action('genesis_header_right','genesis_do_nav'); 
add_theme_support('genesis-structural-wraps', array('header', 'menu-secondary', 'footer-widgets', 'footer'));//menu-primary is removed 

實際上,你可以只是在代碼的開頭添加remove_action和ADD_ACTION功能,僅此便可重新定位菜單。 remove_action完全移開菜單,add_action將它添加到新的位置。