Wrap a div


I need to wrap an existing div on a new div with different classes. I have enabled Development mode and the data markup id of the div is beans_fixed_wrap[_header], what html function should I use? Is there a code snippet sample on the docs? Thanks in advanced!


Hi Euclides,

There isn't an example for that specific div but rather how markup and attributes work in Beans in this article. You can find the list of functions available here.

The function you are after in your case is beans_wrap_markup() (see the code reference). Let's put it in practice, here is what you would add to your child theme functions.php:

beans_wrap_markup( 'beans_fixed_wrap[_header]', 'example_header_wrap', 'div', array( 'class' => 'example-class another-class' ) );

Happy coding,


Hey @thierry awesome! This is really great! I wasw able to do what I needed, thanks.

By the way this link is broken: Whoops, no result found!


Glad to hear it works for you. Thanks for the heads up about the link, I updated it 🙂

Happy coding,


Write a reply

Login or register to write a reply, it's free!