1

I'm creating custom elements in WPBakery (formerly Visual Composer), but encountering issues with its rendered markup.

For example:

I've created a custom element called text. text currently spans 12 columns in the WP admin:

enter image description here

The rendered markup for this looks like:

<div class="row justify-content-center">

  <div class="text">
    <div class="text-left container">
      <h2>This is header</h2>
      <p>This is content</p>
    </div>
  </div>
  
  <div class="col-sm-12">
    <div class="vc_column-inner">
      <div class="wpb_wrapper"></div>
    </div>
  </div>
  
</div>

As you can see, it's creating an empty col-sm-12 div and not even applying the column styles to text.

Ideally what I want to do is get the column WPBakery is generating and place it in a variable.

This way, I can do something along the lines of:

<div class="text <?php echo $column; ?>">

I think this will be handy when a user eventually decides they want two text blocks next to each other:

enter image description here

So each text block will be col-6.

To summarise, I'm trying to figure out why Bakery is outputting an empty div with columns rather than to wrap around my text block? As I'm not sure why this is happening, the only solution I can think of is to get the column data as a variable and then echo is in the text block.

Freddy
  • 683
  • 4
  • 35
  • 114

0 Answers0