[Support request] How can I have two different Header?

Home Forums Support [Support request] How can I have two different Header?

Home Forums Support How can I have two different Header?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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.

    #2391240
    David
    Staff
    Customer Support

    Hi there,

    are you using a translation plugin to create your English version ?

    #2391445
    jisu

    no, i dont use any plugins. i have eng page.

    #2391857
    Ying
    Staff
    Customer Support

    Can 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!

    #2393880
    jisu

    This is our Korean version of the site
    http://www.swim.im

    This 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.

    #2394355
    Ying
    Staff
    Customer Support

    I 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;
    }
    #2394358
    Ying
    Staff
    Customer Support

    And if you want to header with different language, it’s better to use a multi language plugin.

    #2394617
    jisu

    Where do I put the code in?

    #2394625
    jisu

    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?

    #2395040
    David
    Staff
    Customer Support

    1. 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 the english-language body class.

    2. Add this CSS to your site:

    
    .english-language li#menu-item-833 {
        display: none;
    }
    #2396731
    jisu

    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?

    #2396746
    David
    Staff
    Customer Support

    Ok, 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.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.