• ibab

    (@ibab)


    My client is using the Purity v2.3 on the latest version of WordPress. For some reason the responsive navigation is not working. All I see is selection menu with one option, which is “Select page:”.

    Here is the responsive_select_nav function from functions.php

    function responsive_select_nav() {
    
    	$locations = get_nav_menu_locations();
    	$menu = wp_get_nav_menu_object( $locations[ 'custom_menu' ] );
    
    	$items = wp_get_nav_menu_items($menu->term_id);
    	global $of_option;
    	$prefix = "st_";
    	if($of_option[$prefix.'translate']){
    		$tr_select_page = $of_option[$prefix.'tr_select_page'];
    	}else{
    		$tr_select_page = __('Select page:', 'spacing');
    	}
    	echo "<select id='page_id' name='page_id'>";
    	echo "<option>".$tr_select_page."</option>";
    	   foreach ($items as $list){
    			  if($list->menu_item_parent != "0"){
    				echo "<option value=".$list->url.">? ?".$list->title."</option>";
    			  }
    			  else {
    				echo "<option value=".$list->url.">".$list->title."</option>";
    			  }
    
    	   }
    	echo "</select>";
    }

    And in header.php it’s added like so.

    <div class="nav">
                        <ul>
                        	<?php wp_nav_menu(array('menu' => 'custom_menu')); ?>
                        </ul>
                        <?php responsive_select_nav() ?>
                	</div>

    What is wrong? Why is it not displaying?

  • The topic ‘[Theme: Purity] Responsive navigation displays blank’ is closed to new replies.