• Hi there,

    Im in the process of setting up a Chinese and English Language version of an ecommerce multi-site using the Lithestore theme.

    Ive managed to create Child sites for both language versions and would like to modify the section headers in Lithestore to be in Chinese Langauge (the default is English). I found out that the headers are specified in the following:

    themes/lithestore-child/framework/woocommerce/template-tags.php

    Thus I created two child sites, one for the Chinese site and one of the English version.

    However, when I modify the template-tags.php file for the chinese language version of the site, it does not seem to be updating.

    Please let me know if there is anything I might be missing.

    Note: I am not an experienced WP developer! so your kind advise would be appreciated.

    Thank you!
    LCB1982

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author badjohnny

    (@badjohnny)

    Hi

    Sorry for this issue.

    I’m not sure how you modified template-tags.php file in your child theme, but anyway, you can try the following solution.

    First of all, don’t modify the related functions which is located in template-tags.php, just use hook, let’s check the header hook below

    /**
     * Header
     * @see lithestore_before_navigation()
     * @see lithestore_custom_logo()
     * @see lithestore_primary_navigation()
     * @see lithestore_top_buttons()
     * @see lithestore_after_navigation()
     * @see lithestore_cover()	
     */
    add_action( 'lithestore_header', 'lithestore_before_navigation',0);
    add_action( 'lithestore_header', 'lithestore_custom_logo',10);
    add_action( 'lithestore_header', 'lithestore_primary_navigation',20);
    add_action( 'lithestore_header', 'lithestore_top_buttons',30);
    add_action( 'lithestore_header', 'lithestore_after_navigation',40);
    add_action( 'lithestore_header', 'lithestore_cover',50);

    You can see the lithestore_header hook includes those functions which you can find them in template-tags.php, right?

    For example, let’s say you want to modify lithestore_primary_navigation function, just copy this function to the functions.php of your child theme, and change the function name to custom_primary_navigation() as below

    /**
     * Primary Navigation
     */
    function custom_primary_navigation(){
    	   echo'<nav id="site-navigation" class="main-navigation ls-grid ls-col7" role="navigation">
    			<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><i class="fa fa-bars"></i></button>'.wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu','echo' => false ) ).'</nav><!-- #site-navigation -->';
    }

    Then, just modify the content, and put the following codes above this function

    remove_action( 'lithestore_header', 'lithestore_primary_navigation',20);
    add_action( 'lithestore_header', 'custom_primary_navigation',20);

    Then, your custom function will replace to the original function.

    The complete code is

    /**
     * Primary Navigation
     */
    remove_action( 'lithestore_header', 'lithestore_primary_navigation',20);
    add_action( 'lithestore_header', 'custom_primary_navigation',20);
    function custom_primary_navigation(){
    	   echo'<nav id="site-navigation" class="main-navigation ls-grid ls-col7" role="navigation">
    			<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><i class="fa fa-bars"></i></button>'.wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu','echo' => false ) ).'</nav><!-- #site-navigation -->';
    }

    Thanks!

    Thread Starter lcb1982

    (@lcb1982)

    Hi John,

    Thanks for this. I just want to change the Section Header name for the Chinese version of my site to Chinese, not English. For example where it says “Recent Products, I’d like to say “近期产品” instead. Not sure where I would change that in the above?

    Regards

    LB

    Theme Author badjohnny

    (@badjohnny)

    You can install Loco translation plugin, just search those English words in this plugin, and translate to your language version.

    Thanks

    Thread Starter lcb1982

    (@lcb1982)

    Thanks you for the suggestions will give it a go !

    Theme Author badjohnny

    (@badjohnny)

    Great!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Different header Text for Multi-sites’ is closed to new replies.