$content = apply_filters('avia_builder_precompile', get_the_content()); } //check first builder element. if its a section or a fullwidth slider we dont need to create the default openeing divs here $first_el = isset(ShortcodeHelper::$tree[0]) ? ShortcodeHelper::$tree[0] : false; $last_el = !empty(ShortcodeHelper::$tree) ? end(ShortcodeHelper::$tree) : false; if (!$first_el || !in_array($first_el['tag'], AviaBuilder::$full_el)) { echo avia_new_section(array('close' => false, 'main_container' => true)); } $content = apply_filters('the_content', $content); $content = apply_filters('avf_template_builder_content', $content); echo $content; $avia_wp_link_pages_args = apply_filters('avf_wp_link_pages_args', array('before' => '<nav class="pagination_split_post">' . __('Pages:', 'avia_framework'), 'after' => '</nav>', 'pagelink' => '<span>%</span>', 'separator' => ' ')); wp_link_pages($avia_wp_link_pages_args); //only close divs if the user didnt add fullwidth slider elements at the end. also skip sidebar if the last element is a slider if (!$last_el || !in_array($last_el['tag'], AviaBuilder::$full_el_no_section)) { $cm = avia_section_close_markup(); echo "</div>"; echo "</div>{$cm} <!-- section close by builder template -->"; //get the sidebar if (is_singular('post')) { $avia_config['currently_viewing'] = 'blog'; } else { $avia_config['currently_viewing'] = 'page'; } get_sidebar(); } else { echo "<div><div>"; } echo avia_sc_section::$close_overlay; echo ' </div><!--end builder template-->'; echo '</div><!-- close default .container_wrap element -->';
function avia_new_section($params = array()) { global $avia_section_markup, $avia_config; $defaults = array('class' => 'main_color', 'bg' => '', 'close' => true, 'open' => true, 'open_structure' => true, 'open_color_wrap' => true, 'data' => '', "style" => '', 'id' => "", 'main_container' => false, 'min_height' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'attach' => "", 'custom_markup' => ''); $defaults = array_merge($defaults, $params); extract($defaults); $post_class = ""; $output = ""; $bg_slider = ""; if ($id) { $id = "id='{$id}'"; } //close old content structure. only necessary when previous element was a section. other fullwidth elements dont need this if ($close) { $cm = avia_section_close_markup(); $output .= "</div></div>{$cm}</div></div>"; } //start new if ($open) { if (function_exists('avia_get_the_id')) { $post_class = "post-entry-" . avia_get_the_id(); } if ($open_color_wrap) { if (!empty($min_height)) { $class .= " av-minimum-height av-minimum-height-" . $min_height; } if (!empty($video)) { $slide = array('shortcode' => 'av_slideshow', 'content' => '', 'attr' => array('id' => '', 'video' => $video, 'slide_type' => 'video', 'video_mute' => true, 'video_loop' => true, 'video_ratio' => $video_ratio, 'video_controls' => 'disabled', 'video_section_bg' => true, 'video_format' => '', 'video_mobile' => '', 'video_mobile_disabled' => $video_mobile_disabled)); $bg_slider = new avia_slideshow(array('content' => array($slide))); $bg_slider->set_extra_class('av-section-video-bg'); $class .= " av-section-with-video-bg"; $class .= !empty($video_mobile_disabled) ? " av-section-mobile-video-disabled" : ""; $data .= " data-section-video-ratio='{$video_ratio}'"; } $output .= "<div {$id} class='{$class} container_wrap " . avia_layout_class('main', false) . "' {$bg} {$data} {$style}>"; $output .= !empty($bg_slider) ? $bg_slider->html() : ""; $output .= $attach; $output .= apply_filters('avf_section_container_add', '', $defaults); } //this applies only for sections. other fullwidth elements dont need the container for centering if ($open_structure) { if (!empty($main_container)) { $markup = 'main ' . avia_markup_helper(array('context' => 'content', 'echo' => false, 'custom_markup' => $custom_markup)); $avia_section_markup = 'main'; } else { $markup = "div"; } $output .= "<div class='container'>"; $output .= "<{$markup} class='template-page content " . avia_layout_class('content', false) . " units'>"; $output .= "<div class='post-entry post-entry-type-page {$post_class}'>"; $output .= "<div class='entry-content-wrapper clearfix'>"; } } return $output; }