此代碼放在兒童主題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將它添加到新的位置。