• Hello!
    I recently found out that my drop down menu on http://www.sofistik-jivo.com doesn’t show up. It used to be there a week or so ago, but not any longer.
    I’m using a free theme which supports 2 menus that used to work perfectly until now.
    I think I’ve done everything right at the Appearance > Menu Section, because it worked before. Here is a screenshot

    Ane I guess this below is the code that refers to the MENUS in my functions.php.
    I’m quite new to WordPress so I’d appreciate any help! Thank you!

    function smt_menu($a) {
    		$a=preg_replace("/<ul\sclass='children'>/", "<ul class='children'$2><div class='transparent'></div><div class='inner'>", $a);
    		$a=preg_replace('/<ul\sclass="sub-menu">/', "<ul class='sub-menu'><div class='transparent'></div><div class='inner'>", $a);
    		$a=preg_replace("/<\/ul>/", "</div></ul>", $a);
    		return $a;
    	}
    	add_filter('wp_list_categories', 'smt_menu');
    	add_filter('wp_list_pages', 'smt_menu');
    	add_filter('wp_nav_menu_items', 'smt_menu');
    	function block_main_menu() {
    	global $SMTheme;
    		?>
    		 <div class="menu-primary-container">
    			<ul class="menus menu-primary">
                    <li <?php if(is_home() || is_front_page()) { ?>class="current_page_item"<?php } ?>><a href="<?php echo home_url(); ?>/"><?php echo $SMTheme->_(  'homelink' );?></a></li>
    				<?php wp_list_categories('title_li=&'); ?>
    			</ul>
    		</div>
    		<?php
    	}
    
    	function block_sec_menu() {
    		?><div class='menu-topmenu-container'><ul class="menus">
    				<?php wp_list_pages('title_li=&'); ?>
    			</ul></div>
    		<?php
    	}
    	function block_sec_menu_mobile() {
    		?>
    		<script>
    			jQuery(document).ready(function(){
    				jQuery('.menu-topmenu-container li').each(function() {
    					jQuery('<option />', {
    					'value':jQuery(this).find('a').attr('href'),
    					'text':jQuery(this).find('a').html()
    					}).appendTo(jQuery('#mobile-sec-menu'));
    				});
    			});
    		</script>
    		<?php
    	}
    	function block_main_menu_mobile() {
    		?>
    		<script>
    			jQuery(document).ready(function(){
    				jQuery('.menu-primary li').each(function() {
    					jQuery('<option />', {
    					'value':jQuery(this).find('a').attr('href'),
    					'text':jQuery(this).find('a').html()
    					}).appendTo(jQuery('#mobile-main-menu'));
    				});
    			});
    		</script>
    		<?php
    	}
    
    	function smt_mobile_menu($menu_name) {
    		echo '<select class=\'mobile-menu\' id=\'mobile-'.$menu_name.'\'>';
    		echo '<option value=\'#\'>Go to ...</option>';
    		 if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
    			$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
    			if ($menu_items = wp_get_nav_menu_items($menu->term_id)) {
    				$sub=array();
    				foreach ($menu_items as $key => $menu_item ) {
    					if ($menu_item->menu_item_parent==0) $sub[$menu_item->ID]=''; else $sub[$menu_item->ID]=$sub[$menu_item->menu_item_parent].'- ';
    					echo '<option value=\''.$menu_item->url . '\'>' .$sub[$menu_item->ID]. $menu_item->title . '</option>';
    				}
    			} else {
    				$func='block_'.preg_replace('/-/', '_', $menu_name).'_mobile';
    				if (is_callable($func)) {
    					$func();
    				}
    			}
    		} else {
    			$func='block_'.preg_replace('/-/', '_', $menu_name).'_mobile';
    			if (is_callable($func)) {
    				$func();
    			}
    		}
    		echo '</select>';
    	}
Viewing 1 replies (of 1 total)
  • I’m sorry but your chosen theme is not released under GPL. Official WordPress policy states that all plugins and themes that are publicly released are required to adhere to http://ww.wp.xz.cn/about/gpl/

    I would also strongly recommend that you read this article and consider changing to a theme from a reputable source asap.

Viewing 1 replies (of 1 total)

The topic ‘Dropdown menu doesn't show up’ is closed to new replies.