Title: nmilner's Replies | WordPress.org

---

# nmilner

  [  ](https://wordpress.org/support/users/nmilner/)

 *   [Profile](https://wordpress.org/support/users/nmilner/)
 *   [Topics Started](https://wordpress.org/support/users/nmilner/topics/)
 *   [Replies Created](https://wordpress.org/support/users/nmilner/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/nmilner/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/nmilner/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/nmilner/engagements/)
 *   [Favorites](https://wordpress.org/support/users/nmilner/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[GeneratePress] Change the Pimary menu using php](https://wordpress.org/support/topic/change-the-pimary-menu-using-php/)
 *  Thread Starter [nmilner](https://wordpress.org/support/users/nmilner/)
 * (@nmilner)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/change-the-pimary-menu-using-php/#post-16248083)
 * [@diggeddy](https://wordpress.org/support/users/diggeddy/) : thank you ever so
   much – exactly what I needed 🙂
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[GeneratePress] Change the Pimary menu using php](https://wordpress.org/support/topic/change-the-pimary-menu-using-php/)
 *  Thread Starter [nmilner](https://wordpress.org/support/users/nmilner/)
 * (@nmilner)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/change-the-pimary-menu-using-php/#post-16247066)
 * Sorry, I haven’t really explained what I am doing very well.
 * I have a plugin that I wrote which changes the primary menu based on the wordpress
   page and the code above is what is in my plugin. It has worked fine until I used
   it with the GeneratePress theme.
 * I have been researching and I tried also using [this](https://rochcass.wordpress.com/2016/01/14/wordpress-create-menu-locations-and-assigning-menus-programmatically/)
   to change the primary menu set in the theme but now I get no menus at all :/
 * I have a number of Menus defined in the wordpress site and all I’m trying to 
   do is change the menu used by GeneratePress as the primary menu based on the 
   page that is is being displayed. I guess I’m going down the wrong track with 
   the snippets I have used and therefore I’d be grateful if you could tell me the
   correct me to have my plugin change the menu used for the primary menu in GeneratePress
   based on the page that has loaded.

Viewing 2 replies - 1 through 2 (of 2 total)