Title: Menu Customisation &#8211; Urgent
Last modified: August 20, 2016

---

# Menu Customisation – Urgent

 *  [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/)
 * Greetings WordPress Community,
 * I’m looking to alter the way in which my Menu operates. You can view what I am
   trying to achieve at: [http://cleaning.greenchoicegroup.com](http://cleaning.greenchoicegroup.com)
 * I’m trying to have my menu system display Home Page only on any Sub Pages that
   I’ve created. In the link above, you can see that there is no “Home Page” on 
   the front, yet I wish there to be on any of the sub-pages I create within that
   site.
 * The purpose of this is to have a Home Page link on any sub-pages allowing them
   to return to the Home Page, without it displaying on the Home Page, causing confusion.
 * Here is the code that handles my menu system.
 *     ```
       <div id="menu" class="alignleft">
                                       <?php if( function_exists('wp_nav_menu') && has_nav_menu('primary'))
                                           {
                                                       wp_nav_menu( array('menu_id'=> '','container'=>''));
                                           }
                                                  else {
                                                       echo '<ul>';
                                                               wp_list_pages('title_li=');
                                                       echo '</ul>';
                                                  }
                                           ?>
       			</div>
       ```
   

Viewing 15 replies - 1 through 15 (of 23 total)

1 [2](https://wordpress.org/support/topic/menu-menu-customisation/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/menu-menu-customisation/page/2/?output_format=md)

 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533481)
 * Hi,
 * Simplest way is use the the home link before you pages list:
 *     ```
       <ul>
       <li><a href="<?php get_settings('home'); ?>">Home</a></li>
           <?php wp_list_pages('title_li='); ?>
       </ul>
       ```
   
 *  Thread Starter [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533482)
 * Vishal,
 * Firstly, as far as I’ve tried whenever using `<li> or </li>`I get errors related
   to them.
 * Along with this, I am wanting to hide the “Home” on any of my Home Pages. But
   still show it on the Sub Pages.
 * I’m thinking something along the lines of an if statement to load either my first,
   or second menu dependant on which page they’re on.
 * If they’re on page one for example then Menu 1 is loaded, however page 2 loads
   Menu 2.
 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533493)
 * What is the error you are getting.
 * Use if(!is_home()) for show the home on other pages only.
 * Thanks
 *  Thread Starter [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533498)
 * How would you structure that then Vishal?
 * I’m trying to include the if(!is_home()) somewhere in the code I showed above,
   and I just displays the entire menu i’ve got.
 * **Edit:**
 * I’m getting the following error using your suggestion:
 * Parse error: syntax error, unexpected ‘<‘ in [directorylistings]/header.php on
   line 94
 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533505)
 * Use this
 *     ```
       <div id="menu" class="alignleft">
        <?php if( function_exists('wp_nav_menu') && has_nav_menu('primary'))
          {
             wp_nav_menu( array('menu_id'=> '','container'=>''));
          }
              else {
                   echo '<ul>';
       	     if(!is_home()) echo "<li><a href=".get_settings('home').">Home</a></li>";
                  wp_list_pages('title_li=');
                  echo '</ul>';
                   }
         ?>
       </div>
       ```
   
 *  Thread Starter [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533509)
 * Thanks Vishal,
 * The menu is appearing as it was originally, but it appears that it isn’t hiding
   the Home Page link at all.
 * It seems as if the if(!is_home()) isn’t working or doing its job properly. It
   shows on all the child pages as intended, but still shows on the Home Page.
 * Would is_page(‘x’) work better?
 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533510)
 * Yes you can use is_page(), add page by id, page name.
 * check this : [http://codex.wordpress.org/Function_Reference/is_page](http://codex.wordpress.org/Function_Reference/is_page)
 *  Thread Starter [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533511)
 * Do you suspect that there is a spelling error within it however? I’ve just noticed
   my coding program is colouring Home as if something isn’t closed.
 * Could you check the: .get_settings(‘home’). section as fully intentional, I’ve
   not used .get_settings before
 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533514)
 * Use get_option(‘home’)
 * and check this for reference
    [http://codex.wordpress.org/Function_Reference/get_option](http://codex.wordpress.org/Function_Reference/get_option)
 *  Thread Starter [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533518)
 * Doesn’t appear to work, despite my best effort I still get either errors or the
   Home Page isn’t showing.
 * Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in [directorylistings]/
   header.php on line 98
 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533521)
 * post you header file code
 *  Thread Starter [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533522)
 * New Error after some changes:
 * Parse error: syntax error, unexpected ‘<‘ in [directorylistings]/header.php on
   line 96
 * Here is the entire chunk of code I am using:
 *     ```
       <div id="menu" class="alignleft">
        <?php if( function_exists('wp_nav_menu') && has_nav_menu('primary'))
          {
             wp_nav_menu( array('menu_id'=> '','container'=>''));
          }
              else {
                   echo '<ul>';
       	     if(!is_home())
       	     	<li><a href="get_option('home')">Home</a></li>;
                  wp_list_pages('title_li=');
                  echo '</ul>';
                   }
         ?>
       </div>
       ```
   
 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533524)
 * Replace with this, you are making wrong syntax.
 *     ```
       <div id="menu" class="alignleft">
        <?php if( function_exists('wp_nav_menu') && has_nav_menu('primary'))
          {
             wp_nav_menu( array('menu_id'=> '','container'=>''));
          }
              else {
                   echo '<ul>';
       	     if(!is_home())
       	     	echo "<li><a href=".get_option('home').">Home</a></li>";
                  wp_list_pages('title_li=');
                  echo '</ul>';
                   }
         ?>
       </div>
       ```
   
 *  Thread Starter [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * (@alec-weekes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533526)
 * Still isn’t working.
 * As you can see in this image ([http://i.imgur.com/XPdW3.jpg](http://i.imgur.com/XPdW3.jpg))
   the `('home').">Home</a></li>";` appears to be coloured, as if something isn’t
   closed or working.
 * I am thankful for you assistance so far, and I appreciate all the help. I’ve 
   never encountered these issues before : /
 *  [Vee](https://wordpress.org/support/users/vishalgularia/)
 * (@vishalgularia)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/#post-2533530)
 * In the line 95, according to your image, remove the semi-colon and blank space
   after closing bracket tag. This is the starting of if statement. Check the code
   i give above.

Viewing 15 replies - 1 through 15 (of 23 total)

1 [2](https://wordpress.org/support/topic/menu-menu-customisation/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/menu-menu-customisation/page/2/?output_format=md)

The topic ‘Menu Customisation – Urgent’ is closed to new replies.

## Tags

 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [navigation](https://wordpress.org/support/topic-tag/navigation/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 23 replies
 * 2 participants
 * Last reply from: [Alec Weekes](https://wordpress.org/support/users/alec-weekes/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/menu-menu-customisation/page/2/#post-2533548)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
