Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #200076

    Hello there, I would like to add the WPML Language Selector function to the social media ribbon above my main menu.

    I am able to do this using the code from either of these posts: Method A or Method B.

    However, neither option gives me the standard WPML format that shows up when I add WPML language selector to a sidebar menu. The main problem here is that the height of the language selector box is too tall, so it would not fit in the narrow social media nav section.

    Also, in some browsers (e.g. latest version of Firefox), the language selector displays completely below the social media nav. This means that it overlaps with the main menu and is inaccessible. Please advise where I can look in the code to style the language selector.

    #200588

    Hi MHM!

    Please use the method which gives you the best result and post a link to your website. We’ll investigate the css code and if possible we’ll provide some code to fix the styling issues.

    Cheers!
    Peter

    #201315

    Hi, Peter,
    Unfortunately, I can’t share the link because my site is under development. Please let me know which file you’d like to review, and I’ll send you any CSS code relevant to WPML language styling.
    Thanks. -MHM-

    #201465

    Hey!

    This makes it really difficult to give you specific instructions. A general hint would be to increase the size of the social icons: http://www.kriesi.at/support/topic/add-youtube-social-icon-to-header/#post-199839 – by going this way you’ll increase the height of the social icon bar and then you’ll have enough space for the dropdown.

    Cheers!
    Peter

    #205211
    This reply has been marked as private.
    #205247

    Hi!

    Please add this on your custom.css or Quick CSS to adjust the height then position the language selector properly:

    #lang_sel_click a, #lang_sel_click a:visited {
    line-height: 5px;
    }
    
    #lang_sel_click {
    position: absolute;
    top: -10px;
    left: -150px;
    }
    
    #lang_sel_click .sub_menu li ul {
    top: 26px;
    left: 10px;
    border-top: none;
    }

    Cheers!
    Ismael

    #205900

    Hey, that worked! Thanks!

    Just need a little help getting it styled:
    * When you click the language switcher, the submenu jumps to the left. This makes it hard if you need to scroll to one of the languages toward the bottom of the list.
    * I’d like to reduce the amount of space / padding above and below each language because it likewise makes the submenu longer and harder to click.
    * Likewise, I’d like to reduce the amount of padding to the left and right of the language names, and maybe reduce the font by one point. The current design makes the submenu longer by pushing some of the language names to a second line.

    I tried adjusting some of the pixels you mentioned above but did not see any changes.

    #205901

    Also — this one is less critical to function but does make a design impact — there are 10 px or so of white space to the left of the menu that I would like to get rid of because the background is not white. If you could help with that too, I’d appreciate it. Thanks again!

    #205903

    Hi!

    Please add following code to Quick CSS and adjust if needed
    1-

    #top .sub_menu li ul { left: 0%; }

    2-

    #top .sub_menu li li a { line-height: 20px; padding: 6px 18px; }

    3-

    #top .sub_menu li li a { font-size: 11px; }
    #lang_sel_click li { width: 140px; }

    4-

    .header_color .sub_menu ul { background-color: inherit; }

    Cheers!
    Yigit

    #205907

    Thanks for your response, Yigit. Unfortunately, this did not make any visible changes either. It made changes to the language switcher that was in the sidebar (i.e. the default one I was replacing) rather than this custom placement one we just added.

    I am going to delete that default language menu from the sidebar in favor of the one in the social media nav ribbon.

    #205912

    Hey!

    It seems like code is not being applied. You can try adding !important to all custom CSS code to force them, for example

    #top .sub_menu li ul { left: 0%!important; }

    Please flush browser cache and settings of caching plugin if you are using any and refresh your page a few times

    Regards,
    Yigit

    #205942

    Thanks again. Replacing all of the semicolons with !important; in the code that you and Ismael gave me has helped some. I have also tweaked the code to adjust padding, line-height, etc.

    This code appears to be almost correct. However, I am still having a few problems:

    • When you click the dropdown button, the first item that pops up below the current is missing its left, right and bottom borders. (Top border is set to none in the code because it would overlap with the current item’s bottom border.) There is also a weird line that is tangential to the menu (to the top right of the first dropdown item).
    • The weird blank space to the left of the current item in the menu is still there. Upon closer look, I do not think it is a matter of color, so I removed the “background-color: inherit;” from the code. It appears that this one item is about 10px narrower than the rest of the items. I have tried to adjust the width, but this did not work. Trying to insert negative margin just moved the entire item, including this blank space.

    Here is the code as I have revised it:

    #lang_sel_click {
    position: absolute!important;
    top: -12px!important;
    left: -150px!important; }
    
    #lang_sel_click a, #lang_sel_click a:visited {
    line-height: 10px!important; } 
    
    #lang_sel_click li { width: 150px!important; } 
    
    #lang_sel_click .sub_menu li ul {
    top: 26px!important;
    left: 0%!important;
    border-top: none!important; } 
    
    #top .sub_menu li ul { left: 0%!important; 
    top: 31px!important; } 
    
    #top .sub_menu li li a { line-height: 22px!important; padding: 3px 10px!important; font-size: 11px!important; border-top: none!important; } 

    Thanks again. Take care.

    • This reply was modified 7 months, 2 weeks ago by  MHM.
    • This reply was modified 7 months, 2 weeks ago by  MHM.
    #205947

    One other thing: The language dropdown menu is opening upon hover. I would prefer if it only opened upon click, so that it does not pop up to obscure the main menu when a visitor accidentally moves a mouse over it. Thank you.

    #205983

    Hi!

    Please add following code to Quick CSS as well
    1-

    #top .sub_menu li li:first-child > a {
    border: solid 1px #cdcdcd!important;
    }

    2-

    .header_color .sub_menu ul { background-color: #f8f8f8!important; }

    3- You are going to need to hire a freelance developer for that kind of customization as it is beyond the scope of support we can provide. You can also request quote here.

    Cheers!
    Yigit

    #206002

    Thanks! I added the border you suggested to the left, right and bottom of the first item, and that looks much better. Still running into the other problems though.

    Could you please take a look at my site from the private link that I posted earlier in this thread? Your second piece of code did not do anything, but don’t worry about looking at that code because the background color is not the cause of the problem. The dropdown menu is all white, so it’s not a problem that this piece of white space is there. The problem is that the border is about 10px inside of the default language item.

    I also do not understand why a line is being created when you click the dropdown button. It pops up to the right of the dropdown menu just below social media navigation menu.

    PS – Thank you for the advice regarding mouseover vs. click.

    #206005

    Hi!

    Please add following code to Quick CSS as well

    #top .sub_menu li ul { width: 151px; }
    #lang_sel_click li { padding-left: 0; }

    That should solve both issues. If not, please create a temporary admin login and post it here privately so we can take a look

    Best regards,
    Yigit

    #206008

    That worked! Just had to figure out one other bit of code to fix the fact that the dropdown part was one pixel to the right of the rest. I fixed it with this:

    #top .sub_menu li li a {
    margin-left: -1px!important; }

    In case anyone else is reading this because they are looking for help with a similar problem, here is the full code we used:

    #lang_sel_click {
    position: absolute!important;
    top: -12px!important;
    left: -150px!important; }
    
    #lang_sel_click a, #lang_sel_click a:visited {
    line-height: 10px!important; } 
    
    #lang_sel_click li { width: 150px!important; } 
    
    #lang_sel_click .sub_menu li ul {
    top: 26px!important;
    left: 0%!important;
    border-top: none!important; } 
    
    #top .sub_menu li ul { left: 0%!important; 
    top: 31px!important; } 
    
    #top .sub_menu li li a { line-height: 22px!important; padding: 3px 10px!important; font-size: 11px!important; border-top: none!important; margin-left: -1px!important; } 
    
    #top .sub_menu li li:first-child > a {
    border-bottom: solid 1px #cdcdcd!important; 
    border-left: solid 1px #cdcdcd!important; 
    border-right: solid 1px #cdcdcd!important; } 
    
    .header_color .sub_menu ul { background-color: #f8f8f8!important; } 
    
    #top .sub_menu li ul { width: 151px!important; } 
    #lang_sel_click li { padding-left: 0!important; } 

    Thanks again for all the brilliant coding help! :)

    #206009

    Hey!

    Glad we could help and thanks for sharing your code :)

    Cheers!
    Yigit

Viewing 18 posts - 1 through 18 (of 18 total)

The topic ‘WPML Language Selector for social nav’ is closed to new replies.