Skip Navigation

[Resolved] I want to remove wrapper divs in all view

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1345421
Screen Shot 2019-09-22 at 09.09.20.png

Hi Toolset,

Please help me to remove wrapper div in all view I created.
I found this solution, but this solution only for single view. I want to remove the wrapped div in all view.

"function prefix_clean_view_output( $out, $id ) {
if ( $id == '375' ) {"

Thanks

#1346445
Screen Shot 2019-09-23 at 11.23.10 AM.png

Hello, to remove the wrapping div for all Views, you can change the "if" statement to test if the $id exists and is greater than zero, like this:

function prefix_clean_view_output( $out, $id ) {
if ( isset($id) && $id > 0 ) {

You could also use the checkbox in any View editor to disable the wrapping div per View. See the screenshot attached here.

One other option is to use an array syntax to test individual Views only (per View ID).

add_filter( 'wpv_filter_wpv_view_shortcode_output', 'prefix_clean_view_output', 5, 2 );
function prefix_clean_view_output( $out, $id ) {
    $view_ids = array(1234,5678,90); // comma-separated list of View IDs you want to remove the paragraph
    if ( in_array($id, $view_ids) ) {
      // add the code to manipulate text strings here
    }
}

Let me know if you have additional questions about these options.