hey there :) i would like to use my secondary menu area for a language switcher and implement a country flag next to my menu item text in the secondary menu. is this possible?
Add country flag to Secondary Menu
(8 posts) (2 voices)-
Posted 1 year ago #
-
Hi,
you need to custom style menu items - every menu item has its own Id attribute, so you can easily target it in CSS
regards,
MichaelPosted 1 year ago # -
is it possible to provide me a piece of code or a little example :) ???
Posted 1 year ago # -
#menu-item-557 > a { padding-left:35px; background:url(...) 0 0 no-repeat; }
where 557 is your desired menu-item ID
:)
regards,
MichaelPosted 1 year ago # -
thanks michael! that's a big step forward but u r still too fast for me :(
so i add this line to my style.css:
#menu-item-557 > a { padding-left:35px; background:url(http://www.site.com/wp-content/uploads/2012/04/flag.png) 0 0 no-repeat; }do i need to change the ID or create something extra?
and what do i need to add to my menu in design > menus > secondary menu?Posted 1 year ago # -
Just replace 557 with your desired menu item ID. Don't create or code anything else.
You can check menu item ID with the firebug :)regards,
MichaelPosted 1 year ago # -
okay...hmmm...i have tried around but now in the end i found a solution. so if someone wants to know...
add this piece of code to your style.css in flare child theme editor:ul > li.gravatar > a,
ul > li.gravatar > a:hover{
display:block;
padding-left:26px !important;
line-height:20px;
background-image:url(http://www.image.com)!important;
background-position:left center !important;
background-repeat:no-repeat !important;
}then go to design > menus and make sure the option "CSS-classes" is enabled...
then add the class gravatar to the css class of your desired menu item.Posted 1 year ago # -
thx for sharing
Posted 1 year ago #
Reply
You must log in to post.