• Resolved andryonline

    (@andryonline)


    After this change in the funciontion.php

    <?php
    /* ------------------------------------------------------------------------- *
     *  Custom functions
    /* ------------------------------------------------------------------------- */
    
    	// Add your custom functions here, or overwrite existing ones. Read more how to use:
    	// http://codex.wordpress.org/Child_Themes
    
    function alx_load() {
    // Load theme languages
    load_theme_textdomain( 'hueman', get_stylesheet_directory().'/languages' );
    }

    In “Theme Options > Styling” “Website Max-width”, “Image Border Radius” and maybe more don’t work. Why?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi andryonline. Creating a function in your child theme, with the same name as a function in the parent theme, means the parent theme function won’t be invoked. The parent theme function contains several other load commands which now are not being executed. You need to copy the entire function to your child theme, and then change only the part you need.

    More information in the theme documentation under “Load certain functionality from the child theme instead”.

    Thread Starter andryonline

    (@andryonline)

    I did not know. Thanks! 😉

    Thread Starter andryonline

    (@andryonline)

    Sorry, but if I want to maintain the functions of the parent theme and only change language files folder (child theme)?

    You put the language files in the /languages folder in your child theme, then load them using the process described in the documentation that I linked above:

    The same method would be used to change language files folder. You would then copy over the whole alx_load() function, but only modify this one line in it:

    // Load theme languages
    load_theme_textdomain( ‘themename’, get_template_directory().’/languages’ );

    To this:

    // Load theme languages
    load_theme_textdomain( ‘themename’, get_stylesheet_directory().’/languages’ );

    Now the language files will be loaded from the /language/ folder of your child theme instead. Simple, isn’t it? This way your changes will always stay safe in your child theme folder, no matter how many updates you do to the parent theme.

    Thread Starter andryonline

    (@andryonline)

    Ok thanks! It works… 😉

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Problem after language change in child theme’ is closed to new replies.