Polylang Menu Integration

miroslav.cihlo
12 Posts
miroslav.cihlo posted this 15 June 2020

Hi all,

I would like to ask you for help once again with my Themler theme on page http://cnchs.karosa.eu. I need to have a Polylang language switcher in my main menu.

In your response to my topic: "https://answers.themler.io/questions/200382/polylang-menu-issue" you gave me some tips for solution but it does not work, unfortunately.

I tried to insert language "minimenu" as described in previous topic (see link above). But I have several troubles with this solution:
1) I cannot find where to hide French and German. I wanna use only Czech and English.
2) I am not able to display flags only.
3) After switching to English I cannot switch back to Czech.

I would like to have only the flag as a part of main menu. See this link: www.czech-neurosurgery.cz. This is also my Themler theme but main menu is made by MegaMenu plugin. I think that is nonsense to use MaxMegaMenu plugin in each case of PolyLang plugin usage. Themler should be able to provide this. I also tried to use MaxMegaMenu plugin as in my www.czech-neurosurgery.cz web. But that plugins does not work.

So, I want to ask you for help to solve it. An issue with placing polylang language swither into menu would help me to solve it in several webs. I prefer to place Polylang language switcher instead of Themler's one.

I am absolutelly unhappy with that :-(

Please once again for you help

Best regards

Míra

Hi all, I would like to ask you for help once again with my Themler theme on page http://cnchs.karosa.eu. I need to have a Polylang language switcher in my main menu. In your response to my topic: "https://answers.themler.io/questions/200382/polylang-menu-issue" you gave me some tips for solution but it does not work, unfortunately. I tried to insert language "minimenu" as described in previous topic (see link above). But I have several troubles with this solution: 1) I cannot find where to hide French and German. I wanna use only Czech and English. 2) I am not able to display flags only. 3) After switching to English I cannot switch back to Czech. I would like to have only the flag as a part of main menu. See this link: www.czech-neurosurgery.cz. This is also my Themler theme but main menu is made by MegaMenu plugin. I think that is nonsense to use MaxMegaMenu plugin in each case of PolyLang plugin usage. Themler should be able to provide this. I also tried to use MaxMegaMenu plugin as in my www.czech-neurosurgery.cz web. But that plugins does not work. So, I want to ask you for help to solve it. An issue with placing polylang language swither into menu would help me to solve it in several webs. I prefer to place Polylang language switcher instead of Themler's one. I am absolutelly unhappy with that :-( Please once again for you help Best regards Míra

Last edited 15 June 2020 by miroslav.cihlo

Vote to pay developers attention to this features or issue.
10 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 17 June 2020

Hello Mira,

I have update language list in Themler. Unfortunately, Themler doesn't allow showing flags instead of label, but you can hide "language" label there, if needed, leaving only English and Czech.

As for the Polylang plugin, I can try showing flags by adding custom code to the files and uploading flag images separately, but they will still be displayed in the Language pop-up (submenu only).
If you ok with that, please, upload flag images to wp-admin -> Library (Media) and let me know when it is done.

Gina
Themler support

Hello Mira, I have update language list in Themler. Unfortunately, Themler doesn't allow showing flags instead of label, but you can hide "language" label there, if needed, leaving only English and Czech. As for the Polylang plugin, I can try showing flags by adding custom code to the files and uploading flag images separately, but they will still be displayed in the Language pop-up (submenu only). If you ok with that, please, upload flag images to wp-admin -> Library (Media) and let me know when it is done. Gina Themler support
miroslav.cihlo
12 Posts
miroslav.cihlo posted this 17 June 2020

Hello Mira,

I have update language list in Themler. Unfortunately, Themler doesn't allow showing flags instead of label, but you can hide "language" label there, if needed, leaving only English and Czech.

As for the Polylang plugin, I can try showing flags by adding custom code to the files and uploading flag images separately, but they will still be displayed in the Language pop-up (submenu only).
If you ok with that, please, upload flag images to wp-admin -> Library (Media) and let me know when it is done.

Gina
Themler support

Hello Gina,

thank you for your response and help. I have uploaded flags some flags into Library. I would preger files cz1.png and eng2.png, it is from the same series. If there was a problem, let me know, I would upload another ones.

Best regards

Míra

> Hello Mira, > > I have update language list in Themler. Unfortunately, Themler doesn't allow showing flags instead of label, but you can hide "language" label there, if needed, leaving only English and Czech. > > As for the Polylang plugin, I can try showing flags by adding custom code to the files and uploading flag images separately, but they will still be displayed in the Language pop-up (submenu only). > If you ok with that, please, upload flag images to wp-admin -> Library (Media) and let me know when it is done. > > Gina > Themler support Hello Gina, thank you for your response and help. I have uploaded flags some flags into Library. I would preger files cz1.png and eng2.png, it is from the same series. If there was a problem, let me know, I would upload another ones. Best regards Míra
Support Team
Support Team posted this 18 June 2020

Hello Mira,

I have added the code and made some settings for Themler's native language control. You can check it on the site.

I can try doing same for the Polylang control but I can't see any dropdown for "Languages" in the menu today (I think I saw it yesterday).

Leaving the code I used here just in case:

.bd-menu-4 li:first-child {
    background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/eng2.png') !important;
    background-repeat: no-repeat;
  background-size:contain!important;
    background-position:center center!important;
}

.bd-menu-4 li:last-child {
    background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/cz1.png') !important;
    background-repeat: no-repeat;
  background-size:contain!important;
  background-position:center center!important;
}

.bd-menu-4 li a, .bd-menu-4 li a:hover {
    color:transparent!important;
}

Gina
Themler Support

Hello Mira, I have added the code and made some settings for Themler's native language control. You can check it on the site. I can try doing same for the Polylang control but I can't see any dropdown for "Languages" in the menu today (I think I saw it yesterday). Leaving the code I used here just in case: .bd-menu-4 li:first-child { background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/eng2.png') !important; background-repeat: no-repeat; background-size:contain!important; background-position:center center!important; } .bd-menu-4 li:last-child { background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/cz1.png') !important; background-repeat: no-repeat; background-size:contain!important; background-position:center center!important; } .bd-menu-4 li a, .bd-menu-4 li a:hover { color:transparent!important; } Gina Themler Support
miroslav.cihlo
12 Posts
miroslav.cihlo posted this 18 June 2020

Hello Mira,

I have added the code and made some settings for Themler's native language control. You can check it on the site.

I can try doing same for the Polylang control but I can't see any dropdown for "Languages" in the menu today (I think I saw it yesterday).

Leaving the code I used here just in case:

.bd-menu-4 li:first-child {
    background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/eng2.png') !important;
    background-repeat: no-repeat;
  background-size:contain!important;
    background-position:center center!important;
}

.bd-menu-4 li:last-child {
    background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/cz1.png') !important;
    background-repeat: no-repeat;
  background-size:contain!important;
  background-position:center center!important;
}

.bd-menu-4 li a, .bd-menu-4 li a:hover {
    color:transparent!important;
}

Gina
Themler Support

Hello Gina,

minimenu looks great, thanks. But with main menu and integration of Polylang language switcher (in main menu as menu item "Jazyky") I have still several troubles:

1) I cannot switch on the dropdown type of menu because then the web breaks down with this message:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16781312 bytes) in /home/www/karosa.eu/www/karosa.eu/wp-includes/functions.php on line 4609

2) I have only two languages (Czech and English) and to have working web (now) it made me to tick "hide active (actual) language" (see the picture below) otherwise I have doubled menu item "Jazyky" (language switcher)

Screenshot of Appearence > Menu

Please could you try to check these troubles with main menu?

Once again thanks for you help

Best regards

Mira

> Hello Mira, > > I have added the code and made some settings for Themler's native language control. You can check it on the site. > > I can try doing same for the Polylang control but I can't see any dropdown for "Languages" in the menu today (I think I saw it yesterday). > > Leaving the code I used here just in case: > > .bd-menu-4 li:first-child { > background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/eng2.png') !important; > background-repeat: no-repeat; > background-size:contain!important; > background-position:center center!important; > } > > .bd-menu-4 li:last-child { > background-image: url('http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/cz1.png') !important; > background-repeat: no-repeat; > background-size:contain!important; > background-position:center center!important; > } > > .bd-menu-4 li a, .bd-menu-4 li a:hover { > color:transparent!important; > } > > Gina > Themler Support Hello Gina, minimenu looks great, thanks. But with main menu and integration of Polylang language switcher (in main menu as menu item "Jazyky") I have still several troubles: 1) I cannot switch on the dropdown type of menu because then the web breaks down with this message: > Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16781312 bytes) in /home/www/karosa.eu/www/karosa.eu/wp-includes/functions.php on line 4609 2) I have only two languages (Czech and English) and to have working web (now) it made me to tick "hide active (actual) language" (see the picture below) otherwise I have doubled menu item "Jazyky" (language switcher) ![Screenshot of Appearence > Menu][1] [1]: http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/menu.jpg Please could you try to check these troubles with main menu? Once again thanks for you help Best regards Mira

Last edited 18 June 2020 by miroslav.cihlo

Support Team
Support Team posted this 19 June 2020

I won't be able to help with duplicated menu item issue, this would require developer's help. As for memory limit, try to do the following (instruction from the web):

"You need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.

Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’

define( 'WP_MEMORY_LIMIT', '256M' );

This code tells WordPress to increase the PHP memory limit to 256MB.

Once you are done, you need to save your changes and upload your wp-config.php file back to your server.
You can now visit your WordPress site and memory exhausted error should disappear now."

Gina
Themler support

I won't be able to help with duplicated menu item issue, this would require developer's help. As for memory limit, try to do the following (instruction from the web): "You need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel. Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’ define( 'WP_MEMORY_LIMIT', '256M' ); This code tells WordPress to increase the PHP memory limit to 256MB. Once you are done, you need to save your changes and upload your wp-config.php file back to your server. You can now visit your WordPress site and memory exhausted error should disappear now." Gina Themler support
miroslav.cihlo
12 Posts
miroslav.cihlo posted this 21 June 2020

I won't be able to help with duplicated menu item issue, this would require developer's help. As for memory limit, try to do the following (instruction from the web):

"You need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.

Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’

define( 'WP_MEMORY_LIMIT', '256M' );

This code tells WordPress to increase the PHP memory limit to 256MB.

Once you are done, you need to save your changes and upload your wp-config.php file back to your server.
You can now visit your WordPress site and memory exhausted error should disappear now."

Gina
Themler support

Hi Gina,

I exceed the memory limit but without any change :-(

Your "minimenu" looks great but it has some issues. The description of language switcher both in main menu and in mini-menu change but the rest of content remains in Czech (it means all the menu items exception language switcher, page content etc.)

So could you help me with this issue?

Thanks again

Best regards

Míra

> I won't be able to help with duplicated menu item issue, this would require developer's help. As for memory limit, try to do the following (instruction from the web): > > "You need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel. > > Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’ > > > define( 'WP_MEMORY_LIMIT', '256M' ); > > This code tells WordPress to increase the PHP memory limit to 256MB. > > Once you are done, you need to save your changes and upload your wp-config.php file back to your server. > You can now visit your WordPress site and memory exhausted error should disappear now." > > Gina > Themler support Hi Gina, I exceed the memory limit but without any change :-( Your "minimenu" looks great but it has some issues. The description of language switcher both in main menu and in mini-menu change but the rest of content remains in Czech (it means all the menu items exception language switcher, page content etc.) So could you help me with this issue? Thanks again Best regards Míra
Support Team
Support Team posted this 22 June 2020

Could you please provide an example of a page that exists in both languages in wp-admin?

Gina

Could you please provide an example of a page that exists in both languages in wp-admin? Gina
miroslav.cihlo
12 Posts
miroslav.cihlo posted this 22 June 2020

Using Polylang language switcher changes all the thinks exception language switcher own. But using Themler language switcher changes Polylang language switcher (Jazyky to Languages) but all the contenct remains in Czech. Included images show changes using polylang switcher ("Jazyky" item in main menu). Czech version first, english is the second one.

Czech version

English version

Using Polylang language switcher changes all the thinks exception language switcher own. But using Themler language switcher changes Polylang language switcher (Jazyky to Languages) but all the contenct remains in Czech. Included images show changes using polylang switcher ("Jazyky" item in main menu). Czech version first, english is the second one. ![Czech version][1] ![English version][2] [1]: http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/page_cz.jpg [2]: http://cnchs.karosa.eu/wp-content/uploads/sites/13/2020/06/page_en.jpg

Last edited 22 June 2020 by miroslav.cihlo

Support Team posted this 23 June 2020

Sorry for the delay.

I have removed Themler native langiage switcher.

I have added a Widget Area to header and then created a new menu with a single item "Languages" in it. Then added a menu widget to that new widget area and assigned Languages menu to it.

I have also added custom CSS code for the menu to work on hover:

#menu-language .sub-menu li {
    display:none;
    padding-left:0;
    margin-left:-40px!important;
    padding-top: 5px!important;
}
#menu-language:hover .sub-menu li {
    display:block;
}
#menu-language li:before {
    content:none!important;
}
#menu-language a, #menu-language a img{
        width:30px!important;
    height:auto!important;
}

So now you can see Polylang menu switcher on the right.

Gina
Themler Support

Sorry for the delay. I have removed Themler native langiage switcher. I have added a Widget Area to header and then created a new menu with a single item "Languages" in it. Then added a menu widget to that new widget area and assigned Languages menu to it. I have also added custom CSS code for the menu to work on hover: #menu-language .sub-menu li { display:none; padding-left:0; margin-left:-40px!important; padding-top: 5px!important; } #menu-language:hover .sub-menu li { display:block; } #menu-language li:before { content:none!important; } #menu-language a, #menu-language a img{ width:30px!important; height:auto!important; } So now you can see Polylang menu switcher on the right. Gina Themler Support
miroslav.cihlo
12 Posts
miroslav.cihlo posted this 23 June 2020

Dear Gina,

now it works well and also looks great. I am absolutely satisfied with it.

Thank you very much for help

Best regards

Mira

Dear Gina, now it works well and also looks great. I am absolutely satisfied with it. Thank you very much for help Best regards Mira
You must log in or register to leave comments