- This topic has 36 replies, 8 voices, and was last updated 6 years, 6 months ago by Leo.
-
AuthorPosts
-
April 23, 2015 at 8:01 am #101532Mike Tolliver
Hi Tom,
At some point when adjusting my website, I put the site search function inside the primary navigation bar, justified to the far right.
Following this guide:
http://generatepress.com/forums/topic/social-networks-buttons-on-nav-menu-bar/
I managed to put the social icons into the nav bar and justified them right using the ‘!important’ command in the css (couldnt get it to work otherwise).Now the social icons are all the way to the right with the search icon immediately to the left of those. I would prefer the search icon on the far right, but I cant even find the setting I originally did to place the search bar in the primary nav in the first place. I feel like I am taking crazy pills. Any suggestions?
April 23, 2015 at 9:57 am #101622TomLead DeveloperLead DeveloperHa, I’m actually working on this right now – check out our demo and you’ll see the same problem (http://generatepress.com/demo). I want the search on the far right as well.
I’ll figure out a solution and will post it here π
The option to place the search icon in the navigation can be found in “Appearance > Customize > Layout” – it’s the “Navigation Search” option.
Thanks!
April 24, 2015 at 9:27 am #101951Mike TolliverAwesome! Thanks for the speeding support and direction. I would have no hope of being able to build my own website without tools like GP and customer support like yours. Thanks again!
April 24, 2015 at 10:34 am #102032TomLead DeveloperLead DeveloperYou’re welcome! π
April 24, 2015 at 10:42 am #102033TomLead DeveloperLead DeveloperFound a solution. This will allow you to place the search icon wherever you like in your navigation.
1. Add this CSS:
.main-navigation .search-item { display: none; } .main-navigation .search-item.custom { display: block; }
First block will hide the default search button.
Second block will show our soon to be added menu item.
2. Go to “Appearance > Menus”. At the top right, click “Screen Options” and make sure the “CSS Classes” checkbox is checked.
On the left, open the “Custom Links” module.
For the URL, add: #
For the Link text, add:
<i class="fa fa-search"></i>
For the CSS class, add:
search-item custom
3. Add the menu item to your menu, and place it wherever you like.
This hasn’t been tested as a sub-menu item, and it probably won’t work as one, so definitely keep it as a top level menu item.
Hope this helps! π
April 24, 2015 at 12:13 pm #102046Mike TolliverWorked like a charm!
April 24, 2015 at 2:32 pm #102066TomLead DeveloperLead DeveloperAwesome! π
June 4, 2015 at 11:10 pm #112577JosephI followed your css and menu setup and it worked great with the exception of two issues.
1) The default search icon still displays although the css is saying not to.
.main-navigation .search-item {
display: none;
}2) I increased the size of the icon to match the social media to
<i class=”fa fa-search fa-2x”></i> and that worked perfectly but after I do a search and click on the “x” to close the search bar, the search icon goes back to original size (smaller)Everything is set just as mentioned above and the css is in the GP child theme.
You can see what I am talking about here:
(http://provinciawebdesign.com/disruptup/?page_id=46)Thanking you in advance!!!
June 5, 2015 at 12:15 am #112597TomLead DeveloperLead Developer1. Ah – try adding !important to it – the navigation floating to the right is overwriting it:
.main-navigation .search-item { display: none !important; }
2. This is because the JS replaces the code between the X and search icon, and it doesn’t know to add 2x to it. Instead, try this:
.main-navigation .search-item.custom i { font-size: 2em; }
June 5, 2015 at 1:19 am #112614JosephAdding the !Important knocked both of the search icons off. I do have the Navigational Search enabled and I removed the fa-2x from the menu to <i class=”fa fa-search”></i>
So in the Child Theme this is what I have.
.main-navigation .search-item {
display: none !important;
}.main-navigation .search-item .custom {
display: block;
}.main-navigation .search-item .custom i {
font-size: 2em;
}Don’t know why it is hiding both icons.
Thanks Tom!!
June 5, 2015 at 8:32 am #112750TomLead DeveloperLead Developer!important is pretty strong – my mistake.
You’ll have to also add it to the custom icon:
.main-navigation .search-item.custom { display: block !important; }
June 7, 2015 at 6:22 am #112989Graham LeatherbarrowFollowed your instructions and at the moment I get 2 icons on the nav menu. When clicked both seem to fade the the bottom line of nave menu.
htpp://www.isleofskybedandbreakfast.com
Thanks in advanced.
Graham.
June 7, 2015 at 8:01 am #113002TomLead DeveloperLead DeveloperYour website doesn’t seem to be loading for me.
Let me know π
June 7, 2015 at 12:27 pm #113043Graham LeatherbarrowSorry Tom, typing error:
June 8, 2015 at 12:20 am #113079TomLead DeveloperLead DeveloperIf you’re using the float right navigation position, this is the CSS you should use:
.main-navigation .search-item { display: none !important; } .main-navigation .search-item.custom { display: block !important; }
-
AuthorPosts
- You must be logged in to reply to this topic.