- This topic has 11 replies, 2 voices, and was last updated 4 years, 12 months ago by Leo.
-
AuthorPosts
-
April 26, 2019 at 8:37 am #880578María
I would like to know what’s the best way to customize the language switcher if I’m using the free version of Polylang.
As you can see in the attached link we already use the dropdown option. We still want to add the rectangle around the current language and change the background color of the dropdown menu too, like on this site https://nfclinguistic.com/Thank you
April 26, 2019 at 8:53 am #880600LeoStaffCustomer SupportHi there,
This should help for the border:
https://docs.generatepress.com/article/adding-buttons-navigation/Submenu colors are included in the customizer:
https://docs.generatepress.com/article/colors-overview/Let me know if this helps 🙂
April 26, 2019 at 9:08 am #880625MaríaHi Leo, thanks for the reply. I understand how it works, just cannot think of a way to make it work for the Language Switcher. It’s the only menu item that doesn’t include the CSS Classes field. All the other items are added to menu via the “Pages” option on the left, but the Language Switcher acts as a Custom link. Is there a way to add a custom class to the Language Switcher in this case?
April 26, 2019 at 10:43 am #880735LeoStaffCustomer SupportSo did you add the language switcher as a menu item using a custom link?
You can definitely add CSS class to a custom link:
https://www.screencast.com/t/1PvKOdAktXTApril 26, 2019 at 11:06 am #880751MaríaI added the language switcher using this “language switcher” metabox that came up on the menu on the left after I installed Polylang. The list of menu items shows it as a custom link, but with specific “language switcher” settings.
Here’s the screenshot that shows it https://drive.google.com/file/d/1kJQVTyg1ilKQAxOWCxuDBifW7z3LQ9Pz/view?usp=sharingTried this link from their documentation but still cant figure it out https://polylang.wordpress.com/documentation/frequently-asked-questions/the-language-switcher/
April 26, 2019 at 11:42 am #880781LeoStaffCustomer SupportJust to make sure…CSS classes is checked in screen options?
https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classesApril 26, 2019 at 12:22 pm #880809MaríaYes, CSS classes is checked. I managed to add it to the home menu item for example
April 26, 2019 at 1:11 pm #880849LeoStaffCustomer SupportAhh looks like it already has a custom class added.
Try this:
@media (min-width:769px) { .main-navigation .main-nav ul li.pll-parent-menu-item > a { background-color: #ffffff; border: 2px solid #000000; color: #000000; line-height: 35px; /*this number will likely need to be adjusted*/ } }
April 26, 2019 at 3:03 pm #880921MaríaThanks a lot Leo. That works! However, it changes the style of both the current language and the dropdown menu. Is there a way to only add the border to the current language and not for the submenu? If you can please take a look at the link you can check how it looks now and see what I mean.
April 26, 2019 at 5:18 pm #880997LeoStaffCustomer SupportAdjusted the CSS above:
https://generatepress.com/forums/topic/customize-polylang-language-switcher/#post-880849Let me know 🙂
April 27, 2019 at 6:28 am #881352MaríaYes, perfect! Thank you Leo
April 27, 2019 at 10:46 am #881631LeoStaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.