Title: custom_page.php &#8211; set Main Menu
Last modified: August 21, 2016

---

# custom_page.php – set Main Menu

 *  [dropzoneweb](https://wordpress.org/support/users/dropzoneweb/)
 * (@dropzoneweb)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/custom_pagephp-set-main-menu/)
 * I would like to dynamically set the Theme’s top level Main Menu on pages that
   use the Custom Page Example template and have a CustomField MainMenu.
 * I have two custom menus – Main and CareerPortal. In WordPress administration 
   Menu – Menu Locations the Theme Location Main Menu is set to Main.
 * On some pages, the Page Attributes – Template is set to Custom Page Example. 
   I have created a Custom Field called MainMenu with a value of CareerPortal.
 * I have moved custom_page.php from the Customizr folder into the customizr-child
   folder (I installed the child theme using the plugin).
 * As a test, I have inserted a ‘wp_nav_menu’:
 * `wp_nav_menu( array( 'container' => 'none', 'container_class' => 'menu-header','
   theme_location' => 'Main Menu', 'menu' => get_post_meta( $post->ID, 'MenuName',
   true) ) );`
 * into the following hook and it works
 * `<?php do_action( '__before_main_container' ); ##hook of the featured page (priority
   10) and breadcrumb (priority 20)...and whatever you need!?>`
 * but of course it is just sitting there under the breadcrumbs 🙂
 * I do not know how to place it in the Main Menu section of the Theme so it replaces
   Main and inherits the style, features, and functions.
 * Hopefully somebody has already accomplished this and can assist? Here is a link
   to the test page so you can see how it renders:
 * [http://a11.60e.myftpupload.com/careers/](http://a11.60e.myftpupload.com/careers/)
 * To summarize, I want Main menu starting with About Us in the Main Menu section
   of the Theme to be replaced by the CareerPortal menu starting with Rewarding 
   Work that is currently rendering below the breadcrumbs on Pages that use the 
   Custom Page Example template.
 * Thank you!

The topic ‘custom_page.php – set Main Menu’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [dropzoneweb](https://wordpress.org/support/users/dropzoneweb/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/custom_pagephp-set-main-menu/)
 * Status: not resolved