Title: Menu bar&#8230; simple hack needed
Last modified: August 24, 2016

---

# Menu bar… simple hack needed

 *  [RobSamson](https://wordpress.org/support/users/robsamson/)
 * (@robsamson)
 * [11 years ago](https://wordpress.org/support/topic/menu-bar-simple-hack-needed/)
 * Hi,
 * I have a single-page-scroll WordPress theme – the issue I have is in the primary
   navigation. The navigation works fine IF the page title and navigation title 
   are identical.
 * In several cases however, I want to shorten the navigation title in the menu (
   and have a longer page title). Can any coding guys / girls help me with the below…
   I’m convinced I need to change the title to the slug but I’ve tried a few options
   and can’t get it to work!
 * Many thanks in advance !
 * /* Define link target slug for on-page navigation */
    $slug = strtolower( str_replace(”“,“-“,
   $menu_item->title ) ); ?> #page-<?php echo $slug; ?>”> <?php if($menu_item->description!
   = ”) { ?> <span class=”anchor”><?php echo($menu_item->title); ?></span><span 
   class=”description”><?php echo($menu_item->description); ?></span> <?php } else{?
   > <?php echo($menu_item->title); ?><?php echo($menu_item->description); ?> <?
   php } ?> <i class=”fa <?php echo $icon_code; ?>”></i>

The topic ‘Menu bar… simple hack needed’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [RobSamson](https://wordpress.org/support/users/robsamson/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/menu-bar-simple-hack-needed/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
