Change width of drop down menu
-
Site is: http://www.rogues.review/
Can anyone help me figure out how to change the size of drop down menus in general or specifically the one that is “subscribe”
-
Hey there Mitchellcole,
How are you doing today?
As each menu item has it’s own ID you should be able to easily target that specific one and adjust its width with some custom CSS.
Please try adding the following CSS code in the style.css file of your child theme or if your theme doesn’t have custom CSS tab add it in your site using the following plugin:
http://wordpress.org/plugins/simple-custom-css
li#menu-item-50 { width: 215px; padding: 0 30px 10px 30px; }This should be the result http://screencast.com/t/z3NCN7Bevce6.
Hope this helps π
Cheers,
BojanAwesome! that worked like a charm! Any suggestions on how to get that subscribe menu item to be all the way to the right side of the menu bar, on the page?
Hey again,
Glad that the above helped, to move that menu item to the right please try adding the following:
@media screen and (min-width: 600px) { ul#Main_nav { width: 100%; } #menu-item-51 { float: right; } #menu-item-51 ul.sub-menu { margin-left: -200px; } }This should be the result http://screencast.com/t/Pt68h9QmQ.
Hope this helps π
Cheers,
BojanIt did, you are the best!
One last question, How would I go about getting a search box in the nav menu?
I would like it to be to the right of subscribe(so it would be the furthest to the right) and then subscribe directly to the left of it?
Hi,
try this adding this to functions.php, it will be better if you have child theme then ad it to functions.php of your child theme.
add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2); function add_search_box_to_menu( $items, $args ) { if( $args->theme_location == 'primary' ) return $items.get_search_form(); return $items; }Hi,
Found this plugin, have a look may be this will help for adding search box to menus.
https://wordpress.org/plugins/bop-search-box-item-type-for-nav-menus/Hey again Mitchellcole,
This would require editing your theme header.php and adding code to the correct holder.
Please also see the following http://wordpress.stackexchange.com/questions/196885/how-do-i-add-a-search-bar-to-my-header
You’ll also need to adjust CSS in order to have everything in the same line.
Best regards,
Bojan@codemovement that worked! but I’d like it to be aligned all the way to the right, any way of making that happen?
Hi,
if you try this css for pushing search box toward right so it will show like this http://i.imgur.com/q9vX7N8.png
.bop-nav-search.menu-item.menu-item-type-search.menu-item-object-.menu-item-54 { float: right; }
The topic ‘Change width of drop down menu’ is closed to new replies.