Skip to main content
Le panier est vide

Translate for YOOtheme Builder Installation

This tutorial will show you how to install Translate for YOOtheme Page Builder on WordPress.

Falang for Yootheme lite version must be isntalled wth the pro version (since version Falang for Yootheme 1.1)

Falang for WordPress need to be installed and configured with at least 2 languages.

The plugin works with YOOtheme Page Builder version 2.5 and later.

1 - Install the plugin

 

2 - Publish the plugin

In order to start the translation of YOOtheme content you have to publish the plugin, go to your WordPress admin panel. Plugins > Installed Plugins > Falang for Yootheme > Activate the Translate YOOtheme Builder plugin.

 

3 - Information

To translate the teaser on 2.5 YOOtheme version the file PostType.php must be modified.
wp-content/themes/yootheme/vendor/yootheme/builder-wordpress-source/src/Type/PostType.php
 
the function teaser must be changed like this
 
from
    public static function teaser($post, $args)
    {
        $args += ['show_excerpt' => true];

        if ($args['show_excerpt'] && has_excerpt($post)) {
            return get_the_excerpt($post);
        }

        $extended = get_extended($post->post_content);
        $teaser = $extended['main'];

        // Having multiple `<!-- wp:more -->` blocks confuses the parse_blocks function
        if (has_blocks($teaser)) {
            $teaser = do_blocks($teaser);
        }

        return $teaser;
    }
to
    public static function teaser($post, $args)
    {
        $args += ['show_excerpt' => true];

        if ($args['show_excerpt'] && has_excerpt($post)) {
            return get_the_excerpt($post);
        }
        //sbou
        $post_id = $post->ID;
        global $post;
        $post = get_post($post_id);
        setup_postdata( $post );
        $extended = get_extended(apply_filters('the_content',$post->post_content));
        wp_reset_postdata();
        //fin sbou
        //$extended = get_extended($post->post_content);
        $teaser = $extended['main'];

        // Having multiple `<!-- wp:more -->` blocks confuses the parse_blocks function
        if (has_blocks($teaser)) {
            $teaser = do_blocks($teaser);
        }

        return $teaser;
    }