Title: can&#039;t modify menus
Last modified: August 22, 2016

---

# can't modify menus

 *  [catcarrot](https://wordpress.org/support/users/catcarrot/)
 * (@catcarrot)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cant-modify-menus/)
 * when trying to add login log out button to the main menu it does not work in 
   this theme but has no problem in others that I use
    this is the way I added the
   buttons: add_filter( ‘wp_nav_menu_items’, ‘add_loginout_link’, 10, 2 ); function
   add_loginout_link( $items, $args ) { if (is_user_logged_in() && $args->theme_location
   == ‘primary’) { $items .= ‘
    - [Log Out](https://wordpress.org/support/topic/cant-modify-menus/&apos;. wp_logout_url() .&apos;?output_format=md)
    - ‘;
       } elseif (!is_user_logged_in() && $args->theme_location == ‘primary’) {
      $items .= ‘
    - [Log In](https://wordpress.org/support/topic/cant-modify-menus/&apos;. site_url(&apos;wp-login.php&apos;) .&apos;?output_format=md)
    - ‘;
       } return $items; }

Viewing 1 replies (of 1 total)

 *  Theme Author [TT Themes](https://wordpress.org/support/users/tomastoman/)
 * (@tomastoman)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cant-modify-menus/#post-5778602)
 * Hi,
 * your code does not work because there is no menu area called “primary” in BrickYard
   theme. The appropriate slug for the Main Header Menu is “main-navigation”:
 *     ```
       add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
       function add_loginout_link( $items, $args ) {
           if (is_user_logged_in() && $args->theme_location == 'main-navigation') {
               $items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>';
           }
           elseif (!is_user_logged_in() && $args->theme_location == 'main-navigation') {
               $items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
           }
           return $items;
       }
       ```
   
 * Best regards,
    Tomas Toman

Viewing 1 replies (of 1 total)

The topic ‘can't modify menus’ is closed to new replies.

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

 * 1 reply
 * 2 participants
 * Last reply from: [TT Themes](https://wordpress.org/support/users/tomastoman/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/cant-modify-menus/#post-5778602)
 * Status: not resolved