Freddy
Freddy

Reputation: 867

Custom element is always full width in WPBakery / Visual Composer

I'm using the WordPress plugin WPBakery (was Visual Composer), where I've created custom elements.

In the editor side, any element can be placed in a row and it's columns can be defined from there, Is there a way to stop that?

For example, I have a custom element called hero. This block will always be col-12 and prevent anything from being places besides this block.

Trying to prevent this:

enter image description here

Is this possible?

Upvotes: 0

Views: 377

Answers (1)

Gabriele Carbonai
Gabriele Carbonai

Reputation: 459

I found the solution.

I added "ob_start" and "return ob_get_clean();" between file inclusion and that is work for me.

public static function output($atts, $content = null)
{
    extract(vc_map_get_attributes('myModule', $atts));
    ob_start();
    include_once('partials/public-display.php');
    return ob_get_clean();
}

Upvotes: 0

Related Questions