- This topic has 11 replies, 3 voices, and was last updated 4 months, 3 weeks ago by
David.
-
AuthorPosts
-
October 28, 2022 at 1:48 am #2391058
jisu
Hi,
I am building an English version of my website.So I need a header in English and I also need to delete the menu on the header which the page is not ready in English.
October 28, 2022 at 4:07 am #2391240David
StaffCustomer SupportHi there,
are you using a translation plugin to create your English version ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 28, 2022 at 6:49 am #2391445jisu
no, i dont use any plugins. i have eng page.
October 28, 2022 at 8:40 am #2391857Ying
StaffCustomer SupportCan you share the page not in English?
If your site’s language is English, there should not be any other pages with other languages.Let me know!
October 30, 2022 at 7:29 am #2393880jisu
This is our Korean version of the site
http://www.swim.imThis is our new Eng Site
http://www.swim.im/eng/I need to hide blog button in my header for ENG version. The blog page only runs in Korean version.
October 30, 2022 at 12:13 pm #2394355Ying
StaffCustomer SupportI can’t access the Korean site as it’s automatically re-directed to the English site.
Try this CSS to hide the blog menu item:
html[lang="en-US"] li#menu-item-833 { display: none; }
October 30, 2022 at 12:14 pm #2394358Ying
StaffCustomer SupportAnd if you want to header with different language, it’s better to use a multi language plugin.
October 30, 2022 at 10:13 pm #2394617jisu
Where do I put the code in?
October 30, 2022 at 10:30 pm #2394625jisu
Hi,
I tried the code but I need to hide blog menu in Eng site(www.swim.im/eng) not Korean domain (www.swim.im)
Can you help with this?October 31, 2022 at 4:56 am #2395040David
StaffCustomer Support1. Can you add this PHP snippet to your site:
add_filter( 'body_class', 'db_add_site_language' ); function db_add_site_language( $classes ) { if ( strpos($_SERVER['REQUEST_URI'], '/eng') !== false ) { $classes[] = 'english-language'; } else { $classes[] = 'korean-language'; } return $classes; }
This doc explains adding PHP:
https://docs.generatepress.com/article/adding-php/
If that works the in it will add a
*-language
class to the pages<body>
tag.
So if the URL contains:/eng
we can then use theenglish-language
body class.2. Add this CSS to your site:
.english-language li#menu-item-833 { display: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 1, 2022 at 6:42 am #2396731jisu
Thank you for response.
I tried the code and it worked but mobile menu still display blog menu. How can you hide blog menu in mobile?November 1, 2022 at 6:49 am #2396746David
StaffCustomer SupportOk, lets do this:
1. In Appearance > Menus – Edit the Menu you have for your Primary Nav, select the element you want to hide in the English menu.
2. Add a CSS Class to that item of
no-english
.
This doc shows you how:https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes
3. Now edit the Menu of your Off Canvas and repeat the above.
4. Change this CSS:
.english-language li#menu-item-833 { display: none; }
to this:
.english-language .no.english { display: none !important; }
Now in the future any Menu Item or Block that you add the
no-english
CSS class to, will be hidden on the English site.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.