Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Making the Menu Bar Centralised
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Making the Menu Bar Centralised
- This topic has 19 replies, 3 voices, and was last updated 10 years by Mohammad – SUPPORT.
-
Posted in: Neighborhood
-
December 4, 2014 at 4:33 pm #133522
Hello,
Is there any CSS code i can add to make the menu centralised?
Thanks!
December 4, 2014 at 4:55 pm #133532Hi,
Please provide me your website url so i can give right exact custom css code.
Thanks
MohammadDecember 4, 2014 at 5:17 pm #133549This reply has been marked as private.December 5, 2014 at 9:30 am #133691I’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
December 5, 2014 at 10:04 am #133704Hi 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!
December 5, 2014 at 1:37 pm #133787Mohammad will assist you shortly 🙂
– Kyle
December 5, 2014 at 2:45 pm #133816Hi,
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
MohammadDecember 5, 2014 at 4:23 pm #133853Hi 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?
December 5, 2014 at 5:23 pm #133868Hi,
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
MohammadDecember 5, 2014 at 5:38 pm #133877<?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;
}
?>December 5, 2014 at 5:39 pm #133879Hi 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.
December 5, 2014 at 5:44 pm #133881Hi,
What is it ? Need any help ?
Thanks
MohammadDecember 5, 2014 at 5:46 pm #133882Thats is the code you provided with the php head and end.
What should i do now? help will be great, thanks!
December 5, 2014 at 5:48 pm #133883Hi,
Please provide me wordpress admin login detail.
Thanks
MohammadDecember 5, 2014 at 5:54 pm #133887This reply has been marked as private. -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.