New Landing How can we help? Themeforest Theme Support Neighborhood Making the Menu Bar Centralised

Viewing 15 posts - 1 through 15 (of 20 total)
  • #133522
    ninesolutions
    Member
    Post count: 192

    Hello,

    Is there any CSS code i can add to make the menu centralised?

    Thanks!

    #133532
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me your website url so i can give right exact custom css code.
    Thanks
    Mohammad

    #133549
    ninesolutions
    Member
    Post count: 192
    This reply has been marked as private.
    #133691
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    I’m afraid that menu can’t be centred as it’s not full width, you have the cart and wishlist icons on the right

    – Kyle

    #133704
    ninesolutions
    Member
    Post count: 192

    Hi Kyle,

    I have removed the cart and search. Would we be able to centralise now?

    Sorry for the torouble, but another question here too. WIll we be able to centralise the text and small images within the SINGLE ELEMENT to? I am refering to this: http://prntscr.com/5detg6

    Thanks!

    #133787
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Mohammad will assist you shortly 🙂

    – Kyle

    #133816
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please post given below php script at functions.php of child theme:-

    function sf_main_menu($id, $layout = "") {
    	
    		// VARIABLES
    		$options = get_option('sf_neighborhood_options');
    		$show_cart = $options['show_cart'];
    		$show_wishlist = $options['show_wishlist'];
    		$disable_search = false;
    		if (isset($options['disable_search'])) {
    			$disable_search = $options['disable_search'];
    		}
    		$menu_output = $menu_full_output = "";
    		$main_menu_args = array(
    			'echo'            => false,
    			'theme_location' => 'main_navigation',
    			'fallback_cb' => ''
    		);
    		
    		
    		// MENU OUTPUT
    		if ($id == "mini-navigation") {
    		$menu_output .= '<nav id="'.$id.'" class="mini-menu clearfix">'. "\n";
    		} else {
    		$menu_output .= '<nav id="'.$id.'" class="clearfix">'. "\n";		
    		}	
    		if(function_exists('wp_nav_menu')) {
    			$menu_output .= wp_nav_menu( $main_menu_args );
    		}
    		$menu_output .= '</nav>'. "\n";
    		
    		
    		// FULL WIDTH MENU OUTPUT
    		if ($layout == "full") {	
    			$menu_full_output .= '<div class="container">'. "\n";
    			$menu_full_output .= '<div class="row">'. "\n";
    			$menu_full_output .= '<div class="span12">'. "\n";
    			$menu_full_output .= $menu_output . "\n";
    			$menu_full_output .= '</div>'. "\n";
    			$menu_full_output .= '<div class="span3 header-right">'. "\n";
    			if ($id == "mini-navigation") {
    			$menu_full_output .= '<nav class="mini-menu">'. "\n";
    			} else {
    			$menu_full_output .= '<nav>'. "\n";			
    			}
    			$menu_full_output .= '<ul class="menu">'. "\n";
    			if (!$disable_search) {
    			$menu_full_output .= '<li class="menu-search no-hover"><a href="#"><i class="fa-search"></i></a>'. "\n";
    			$menu_full_output .= '<ul class="sub-menu">'. "\n";
    			$menu_full_output .= '<li><div class="ajax-search-wrap"><div class="ajax-loading"></div><form method="get" class="ajax-search-form" action="'.home_url().'/"><input type="text" placeholder="'.__("Search", "swiftframework").'" name="s" autocomplete="off" /></form><div class="ajax-search-results"></div></div></li>'. "\n";			
    			$menu_full_output .= '</ul>'. "\n";
    			$menu_full_output .= '</li>'. "\n";
    			}
    			if ($show_cart) {
    			$menu_full_output .= sf_get_cart();
    			}
    			if ( class_exists( 'YITH_WCWL_UI' ) && $show_wishlist)  {
    			$menu_full_output .= sf_get_wishlist();
    			}
    			$menu_full_output .= '</ul>'. "\n";
    			$menu_full_output .= '</nav>'. "\n";
    			$menu_full_output .= '</div>'. "\n";
    			$menu_full_output .= '</div>'. "\n";
    			$menu_full_output .= '</div>'. "\n";
    			
    			$menu_output = $menu_full_output;
    		}
    		
    		
    		// MENU RETURN		
    		return $menu_output;
    	}

    2- Please go to Admin -> Theme Options -> General Options -> Custom CSS and insert given below code:-

    ul#menu-main-menu{display:inline-block !important;}
    div.header-right{display:none !important;}
    #main-navigation > div{text-align:center !important;}

    Thanks
    Mohammad

    #133853
    ninesolutions
    Member
    Post count: 192

    Hi Mohammad,

    thank for the assistance.

    I have copied the 2nd part into the custom CSS.

    However when after i installed the child theme there is no function.php.

    By copying the functions php from main theme to child theme creates a line 135 error to the whole website.

    What shall i do?

    #133868
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please create a blank functions.php file under child theme directory and insert this code. Now you will not get 135 error ike before.
    Thanks
    Mohammad

    #133877
    ninesolutions
    Member
    Post count: 192

    <?php
    function sf_main_menu($id, $layout = “”) {

    // VARIABLES
    $options = get_option(‘sf_neighborhood_options’);
    $show_cart = $options[‘show_cart’];
    $show_wishlist = $options[‘show_wishlist’];
    $disable_search = false;
    if (isset($options[‘disable_search’])) {
    $disable_search = $options[‘disable_search’];
    }
    $menu_output = $menu_full_output = “”;
    $main_menu_args = array(
    ‘echo’ => false,
    ‘theme_location’ => ‘main_navigation’,
    ‘fallback_cb’ => ”
    );

    // MENU OUTPUT
    if ($id == “mini-navigation”) {
    $menu_output .= ‘<nav id=”‘.$id.'” class=”mini-menu clearfix”>’. “\n”;
    } else {
    $menu_output .= ‘<nav id=”‘.$id.'” class=”clearfix”>’. “\n”;
    }
    if(function_exists(‘wp_nav_menu’)) {
    $menu_output .= wp_nav_menu( $main_menu_args );
    }
    $menu_output .= ‘</nav>’. “\n”;

    // FULL WIDTH MENU OUTPUT
    if ($layout == “full”) {
    $menu_full_output .= ‘<div class=”container”>’. “\n”;
    $menu_full_output .= ‘<div class=”row”>’. “\n”;
    $menu_full_output .= ‘<div class=”span12″>’. “\n”;
    $menu_full_output .= $menu_output . “\n”;
    $menu_full_output .= ‘</div>’. “\n”;
    $menu_full_output .= ‘<div class=”span3 header-right”>’. “\n”;
    if ($id == “mini-navigation”) {
    $menu_full_output .= ‘<nav class=”mini-menu”>’. “\n”;
    } else {
    $menu_full_output .= ‘<nav>’. “\n”;
    }
    $menu_full_output .= ‘<ul class=”menu”>’. “\n”;
    if (!$disable_search) {
    $menu_full_output .= ‘<li class=”menu-search no-hover”><i class=”fa-search”></i>‘. “\n”;
    $menu_full_output .= ‘<ul class=”sub-menu”>’. “\n”;
    $menu_full_output .= ‘

  • <div class=”ajax-search-wrap”><div class=”ajax-loading”></div><form method=”get” class=”ajax-search-form” action=”‘.home_url().’/”><input type=”text” placeholder=”‘.__(“Search”, “swiftframework”).'” name=”s” autocomplete=”off” /></form><div class=”ajax-search-results”></div></div>
  • ‘. “\n”;
    $menu_full_output .= ‘‘. “\n”;
    $menu_full_output .= ‘‘. “\n”;
    }
    if ($show_cart) {
    $menu_full_output .= sf_get_cart();
    }
    if ( class_exists( ‘YITH_WCWL_UI’ ) && $show_wishlist) {
    $menu_full_output .= sf_get_wishlist();
    }
    $menu_full_output .= ‘‘. “\n”;
    $menu_full_output .= ‘</nav>’. “\n”;
    $menu_full_output .= ‘</div>’. “\n”;
    $menu_full_output .= ‘</div>’. “\n”;
    $menu_full_output .= ‘</div>’. “\n”;

    $menu_output = $menu_full_output;
    }

    // MENU RETURN
    return $menu_output;
    }
    ?>

#133879
ninesolutions
Member
Post count: 192

Hi Mohammad, Sorry to bother you again.

I added with the <?php at start and ?> at end.

But now my menu bar has disappeared. Am i doing it wrong?

Thank you.

#133881
Mohammad – SUPPORT
Moderator
Post count: 27441

Hi,
What is it ? Need any help ?
Thanks
Mohammad

#133882
ninesolutions
Member
Post count: 192

Thats is the code you provided with the php head and end.

What should i do now? help will be great, thanks!

#133883
Mohammad – SUPPORT
Moderator
Post count: 27441

Hi,
Please provide me wordpress admin login detail.
Thanks
Mohammad

#133887
ninesolutions
Member
Post count: 192
This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register