Title: wp_nav_menu_items &#8211; mobile problem
Last modified: August 22, 2016

---

# wp_nav_menu_items – mobile problem

 *  [shanebp](https://wordpress.org/support/users/shanebp/)
 * (@shanebp)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wp_nav_menu_items-mobile-problem/)
 * I’m using the wp_nav_menu_items filter hook to add a subnav to the main navigation
   for this site: [http://www.newspebbles.com](http://www.newspebbles.com/)
    It 
   uses a child theme for 2013
 *     ```
       function new_nav_menu_items($items) {
       	global $wpdb; 
   
       	$localities_links = '';
   
       	$query = //etc
       	$localities = //etc
   
       	if( $localities ) {	
   
       	    foreach( $localities AS $locality ) {
   
       		$localities_links .= '<li id="menu-item" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="http://www.newspebbles.com/' . $locality->locality_slug . '/">' . $locality->locality_name . '</a></li>';	
   
       	    }
   
       	    $items = str_replace('<a>Localities</a></li>', '<a>Localities</a><ul class="sub-menu">'.$localities_links.'</ul></li>', $items);
       	}
   
           return $items;
       }
       add_filter( 'wp_nav_menu_items', 'new_nav_menu_items' );
       ```
   
 * The ‘Localities’ link ( and all the other links ) was created via Appearance 
   > Menus.
    This works properly on laptops. But on mobile devices the links do 
   not work. On iOS, the ‘Localities’ link does not work. On Android, the ‘Localities’
   link shows the subnav, but the subnav links do not work.
 * What is the recommended solution re main nav on mobile?
    Will I have to use wp_nav_menu
   to create the whole nav menu via code? And / or a custom walker?

The topic ‘wp_nav_menu_items – mobile problem’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [shanebp](https://wordpress.org/support/users/shanebp/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/wp_nav_menu_items-mobile-problem/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
