简体   繁体   中英

Wordpress Custom Navigation on Secondary Theme

I've followed the codex; http://codex.wordpress.org/Navigation_Menus However I believe that because we are trying to do the edits on page that isn't using the main sites theme, it's falling apart.

Our standard theme is Grand College, the theme however we are trying to edit is a BlankSlate theme.

I've made the edits in the BlankSlate functions file and inserted:

function register_my_menu() {
register_nav_menu('example-menu',__( 'EXAMPLE Menu' ));
}
add_action( 'init', 'register_my_menu' );

In the header file I've inserted;

<?php wp_nav_menu( array( 'theme_location' => 'example-menu' ) ); ?>

And in the WP-admin dashboard I've built a menu for 'example': I've added Home and Contact to it. However in the 'Manage Location' section I've only got 2 menu options which is what Grand College gives you by default

However when I view the site, I get the 'main' navigation showing rather than just the example menu.

Do my edits to put a new custom menu in, have to be done on the Grand College theme (The sites standard theme, or am I right to be trying to edit the pages theme?

Any help would be great appreciated.

要注册导航菜单,我只使用了以下代码:

register_nav_menu('example-menu',__( 'EXAMPLE Menu' ));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM