• I would like to thanks Shea Bunge, author of the great “Code Snippets” plugin, for his help and willingness on finding the necessary code to make “WP Multilang” fully work with “Oxygen”.
    Here’s the magick snippet:

    add_filter( 'wpm_json_files', function ( $config_files ) {
    $config_files[] = ABSPATH . 'wpm-config.json';
    return $config_files;
    } );

    Your custom json file: “wpm-config.json” must placed inside your root wordpress install.

    Thanks again Shea !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Anticosti,

    I’m glad to hear it! I’m trying to make this setup work, however when I make changes in the oxygen builder, it changes both the original and the translated page. Can you tell me what my configurations need to look like in the wpm-config.json?

    Regards,
    Jamal

    Thread Starter Anticosti

    (@anticosti)

    Greetings @jamalsauermann,
    I guess I must bring some precisions on my affirmation.

    Here’s the way I have it working with Oxygen:
    01. I downloaded Snippets plugin;
    02. Created a new snippet, with this inside:

    add_shortcode( 'wpm_translate', 'wpm_shortcode_translate' );
    function wpm_shortcode_translate( $atts, $content ) {
        $atts = shortcode_atts( array(
    		'lang' => wpm_get_language()
    	), $atts ); 
    
    	 return wpm_translate_string($content, $atts['lang']);
    }

    03. Now, in Oxygen everywhere I need to translate a Title, I use a Code Block instead a Title. I simply paste this in the Code Block:

    <?php
    echo wpm_translate_string('[:en]My English Title[:fr]Mon titre en Fran?ais[:]');
    ?>

    Note: I don’t use Oxygen as a page builder.
    I use it as a template builder.
    This is why I say it works.

    Let me know how you are doing…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Multilang now works with Oxygen Builder’ is closed to new replies.