Title: customize header and menu button problem
Last modified: August 31, 2016

---

# customize header and menu button problem

 *  Resolved [Masoud](https://wordpress.org/support/users/masoud1111/)
 * (@masoud1111)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/customize-header-and-menu-button-problem/)
 * i am using socialchef theme.
    i want to create 2different menu buttons in the
   header. one for logged in users. and one for NOT logged in users. here is my 
   default header look like. [http://uupload.ir/files/65gv_true_header.jpg](http://uupload.ir/files/65gv_true_header.jpg)
   and here are the codes for those 3 buttons. [http://uupload.ir/files/eit3_true_code.jpg](http://uupload.ir/files/eit3_true_code.jpg)
 * i want to create a situation, where if a user is logged in
    those 3buttons appear
   as “search for recipe”, “my account”, “submit a recipe”.
 * and if a user is NOT logged in, those 3 buttons appear as
    “search for recipe”,“
   LOG IN” , submit a recipe
 * so i used if ( is_user_logged_in() ) to know that if a user us logged in or not.
   and changed the codes and added an
    if ( is_user_logged_in() ) {…} else {…}
 * take a look at the changes i added to default code here:
    [http://uupload.ir/files/beo_changed_code_of_header_caused_error.jpg](http://uupload.ir/files/beo_changed_code_of_header_caused_error.jpg)
   and the results look like this: 1) [http://uupload.ir/files/zx2t_error_header_1_-_zoomed_out.jpg](http://uupload.ir/files/zx2t_error_header_1_-_zoomed_out.jpg)
   2) [http://uupload.ir/files/irj4_error_header_1_-_more_zoomed_out.jpg](http://uupload.ir/files/irj4_error_header_1_-_more_zoomed_out.jpg)
   as you see the menu repeated it self!
 * how can i fix that error and make my changes? tnx for help.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Masoud](https://wordpress.org/support/users/masoud1111/)
 * (@masoud1111)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/customize-header-and-menu-button-problem/#post-7351185)
 * update:
    i solved it. thanks to search i made, and thanks to kathryn: [https://wordpress.org/support/topic/how-do-i-remove-header-menu-from-home-page-only-1?replies=7](https://wordpress.org/support/topic/how-do-i-remove-header-menu-from-home-page-only-1?replies=7)
   answers from 4years ago. i found out that i can also use this form of if:
 * <?php if ( … ): ?>
    <?php endif; ?>
 * when you use this kind, you dont need to open “{” and close your statement with“}”
 * because ” <?php if ( … ): ?> ” is saying that
    your conditional if starts
 * and ” <?php endif; ?> ” is saying that
    your if ends here!
 * so there is no use of {}
 * when i update my statements with those. the problem solved. and now i have 2different
   shape of buttons. one for logged in user. and one for non logged in users!

Viewing 1 replies (of 1 total)

 The topic ‘customize header and menu button problem’ is closed to new replies.

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [header](https://wordpress.org/support/topic-tag/header/)

 * 1 reply
 * 1 participant
 * Last reply from: [Masoud](https://wordpress.org/support/users/masoud1111/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/customize-header-and-menu-button-problem/#post-7351185)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
