}
/* end hide-header-image */
if (weaverx_getopt('title_over_image')) {
    echo '</div><!--/#title-over-image -->' . "\n";
}
weaverx_header_widget_area('after_header');
// show header widget area if set to this position
/* ======== EXTRA HTML ======== */
$extra = weaverx_getopt('header_html_text');
$hide = weaverx_getopt_default('header_html_hide', 'hide-none');
if ($extra == '' && is_customize_preview()) {
    echo '<div id="header-html" style="display:inline;"></div>';
    // need the area there for customizer live preview
} else {
    if ($extra != '' && $hide != 'hide') {
        $c_class = weaverx_area_class('header_html', 'not-pad', '-none', 'margin-none');
        ?>
		<div id="header-html" class="<?php 
        echo $c_class;
        ?>
">
			<?php 
        echo do_shortcode($extra);
        ?>
		</div> <!-- #header-html -->
	<?php 
    }
}
weaverx_header_widget_area('after_html');
// show header widget area if set to this position
do_action('weaverxplus_action', 'header_area_bottom');
/**
 * Adds the classes to the widget in the front-end
 */
function weaverx_add_widget_classes($params)
{
    global $wp_registered_widgets;
    $arr_registered_widgets = wp_get_sidebars_widgets();
    // Get an array of ALL registered widgets
    $sb_id = $params[0]['id'];
    // Get the id for the current sidebar we're processing
    $widget_id = $params[0]['widget_id'];
    // add first, last, even, and odd, and widget classes
    $area_map = array('primary-widget-area' => 'primary', 'secondary-widget-area' => 'secondary', 'footer-widget-area' => 'footer', 'sitewide-top-widget-area' => 'top', 'page-top-widget-area' => 'top', 'postpages-widget-area' => 'top', 'blog-top-widget-area' => 'top', 'sitewide-bottom-widget-area' => 'bottom', 'page-bottom-widget-area' => 'bottom', 'blog-bottom-widget-area' => 'bottom', 'header-widget-area' => 'header_sb', 'footer-widget-area' => 'footer_sb', 'primary' => 'primary', 'secondary' => 'secondary', 'widget' => 'widget', 'header' => 'header_sb', 'footer' => 'footer_sb', 'top' => 'top', 'bottom' => 'bottom');
    $opt_name = 'widget';
    // default styling option name: widget-xxx
    $search_sb_id = $sb_id;
    if (weaverx_t_get('use_widget_area')) {
        // map from replacement area or [extra_widget_area]
        $search_sb_id = weaverx_t_get('use_widget_area');
    }
    foreach ($area_map as $area => $opt) {
        // need to find name to use for option values
        if ($search_sb_id == $area) {
            $opt_name = $opt;
            break;
        }
    }
    $cols = weaverx_getopt_default($opt_name . '_cols_int', 1);
    if ($cols > 8) {
        $cols = 8;
    }
    // sanity check
    $show_number = true;
    $show_evenodd = true;
    if (!isset($arr_registered_widgets[$sb_id]) || !is_array($arr_registered_widgets[$sb_id])) {
        return $params;
    }
    if (empty($GLOBALS['wvr_widget_number']) || !isset($GLOBALS['wvr_widget_number']) || !$GLOBALS['wvr_widget_number']) {
        // global to keep track of which widget this is
        $GLOBALS['wvr_widget_number'] = array();
    }
    if (isset($GLOBALS['wvr_widget_number'][$sb_id])) {
        // initialize or bump widget number
        $GLOBALS['wvr_widget_number'][$sb_id]++;
    } else {
        $GLOBALS['wvr_widget_number'][$sb_id] = 1;
    }
    $is_sidebar = in_array($sb_id, array('primary-widget-area', 'secondary-widget-area'));
    // this is a vertical widget
    $no_smart = weaverx_getopt($opt_name . '_no_widget_margins');
    $is_vert = $cols == 1;
    $per_row_tail = $is_vert || $no_smart ? ' ' : '-m ';
    $class = '';
    $sides = $is_sidebar ? '-b' : '-rb';
    $cur_widget = $GLOBALS['wvr_widget_number'][$sb_id];
    $widget_count = count($arr_registered_widgets[$sb_id]);
    $first = $cur_widget == 1;
    $last = $cur_widget == $widget_count;
    $def_bottom = 'margin-bottom';
    if ($opt_name == 'header_sb') {
        $def_bottom = 'no-margin-vertical ';
    }
    $area_class = weaverx_area_class('widget', 'not-pad', $sides, $def_bottom) . ' ';
    if ($area_class) {
        $class .= $area_class;
    }
    if (!$is_vert) {
        $class .= 'per-row-' . $cols . $per_row_tail;
        $end_of_row = $cur_widget % $cols == 0;
        if ($widget_count > 1 && !$end_of_row && !$no_smart) {
            $class .= 'smart-rm ';
        }
        if ($end_of_row) {
            $class .= 'end-of-row ';
        }
        if ($cur_widget % $cols == 1) {
            $class .= 'begin-of-row ';
        }
    }
    $class .= 'widget-' . $GLOBALS['wvr_widget_number'][$sb_id] . ' ';
    if ($is_vert) {
        $widget_first = 'widget-first widget-first-vert ';
        $widget_last = 'widget-last widget-last-vert ';
    } else {
        $widget_first = 'widget-first ';
        $widget_last = 'widget-last ';
    }
    if ($first) {
        $class .= $widget_first;
    }
    if ($last) {
        $class .= $widget_last;
    }
    if ($show_evenodd) {
        $widget_even = 'widget-even ';
        $widget_odd = 'widget-odd ';
        $class .= $cur_widget % 2 ? $widget_odd : $widget_even;
    }
    // need no-margin-bottom if $cols > 1
    $params[0]['before_widget'] = str_replace('">', ' ' . trim($class) . '">', $params[0]['before_widget']);
    $title_class = weaverx_title_class('widget_title', true);
    if ($title_class) {
        $params[0]['before_title'] = str_replace('">', ' ' . trim($title_class) . '">', $params[0]['before_title']);
    }
    return $params;
}
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
// Bottom Widget Area
$l_area = 'l-sb-right';
if (weaverx_getopt('primary_smartmargin') || weaverx_getopt('secondary_smartmargin')) {
    $l_area .= '-lm';
}
$class = $l_area . ' m-full s-full sb-float-right ' . weaverx_area_class('secondary', 'pad', '', 'margin-bottom');
echo '<div style="clear:right;"></div>';
weaverx_put_widgetarea('secondary-widget-area', $class);
weaverx_clear_both('secondary-widget-area');
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
/**
 * The Left Split Sidebar if on top
 *
 * @package WordPress
 * @subpackage Weaver X
 * @since Weaver Xtreme 1.0
 */
$l_area_left = 'l-sb-left-split-top';
if (weaverx_getopt('primary_smartmargin') || weaverx_getopt('secondary_smartmargin')) {
    $l_area_left .= '-rm';
}
$class = $l_area_left . ' m-full s-full ' . weaverx_area_class('primary', 'pad', '', 'margin-bottom');
if (weaverx_has_widgetarea('primary-widget-area')) {
    weaverx_put_widgetarea('primary-widget-area', $class);
} else {
    if (!weaverx_has_widgetarea('secondary-widget-area')) {
        weaverx_no_sidebars($class);
    }
}
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
/**
 * The Left Sidebar.
 */
$l_area = 'l-sb-left';
if (weaverx_getopt('primary_smartmargin') || weaverx_getopt('secondary_smartmargin')) {
    $l_area .= '-rm';
}
$wrap = '<div class="' . $l_area . ' s-full m-full">';
$p_class = 'l-full m-half-rm ' . weaverx_area_class('primary', 'pad', '', 'margin-bottom');
$s_class = 'l-full m-half-lm ' . weaverx_area_class('secondary', 'pad', '', 'margin-bottom');
if (weaverx_has_widgetarea('primary-widget-area')) {
    echo $wrap;
    // keep the two areas vertical no matter what the content height
    if (weaverx_has_widgetarea('secondary-widget-area')) {
        // both top and bottom
        weaverx_put_widgetarea('primary-widget-area', $p_class);
        weaverx_put_widgetarea('secondary-widget-area', $s_class);
    } else {
        // top only
        $p_class = str_replace('m-half-rm', 'm-full', $p_class);
        weaverx_inject_area('presidebar', $p_class);
        weaverx_put_widgetarea('primary-widget-area', $p_class);
    }
    echo '</div>';
} else {
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
/**
 * The Right Split Sidebar.
 *
 * @package WordPress
 * @subpackage Weaver X
 * @since Weaver Xtreme 1.0
 */
$l_area = 'l-sb-right';
if (weaverx_getopt('primary_smartmargin') || weaverx_getopt('secondary_smartmargin')) {
    $l_area .= '-lm';
}
$class = $l_area . ' m-full s-full l-flow-opposite ' . weaverx_area_class('primary', 'pad', '', 'margin-bottom');
if (weaverx_has_widgetarea('primary-widget-area')) {
    weaverx_put_widgetarea('primary-widget-area', $class);
} else {
    if (!weaverx_has_widgetarea('secondary-widget-area')) {
        weaverx_no_sidebars($class);
    }
}
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
/* Weaver X

Inject - injects userdefined HTML

inject-infobar - adds both the infobar and the user pre-main area. Order of these
two can be swapped easily in a child theme simply by reversing the order here

*/
if (weaverx_getopt('infobar_hide') != 'hide' && !weaverx_is_checked_page_opt('_pp_hide_page_infobar')) {
    // let's really not include it rather than display:none.
    $c_class = weaverx_area_class('infobar', 'not-pad', '-none', 'margin-none');
    ?>

<div id="infobar" class="<?php 
    echo $c_class;
    ?>
">
<?php 
    if (!weaverx_getopt_checked('info_hide_breadcrumbs')) {
        $weaverx_crumbs = '';
        if (has_action('weaverx_breadcrumbs')) {
            // allow anyone to override bradcrumbs via action
            do_action('weaverx_breadcrumbs');
        } else {
            if (function_exists('yoast_breadcrumb')) {
                $weaverx_crumbs = yoast_breadcrumb('  <span id="breadcrumbs">', '</span>', false);
function weaverx_post_class($hidecount = false)
{
    global $weaverx_cur_post_count;
    global $weaverx_sticky;
    if ($weaverx_sticky) {
        // For page with posts - re-ordering sticky posts
        $postclass = 'post-area sticky ';
    } else {
        $postclass = 'post-area  ';
    }
    if ($weaverx_cur_post_count != 0 && !$hidecount) {
        $postclass .= 'post-' . ($weaverx_cur_post_count % 2 ? 'odd' : 'even') . ' post-order-' . $weaverx_cur_post_count . ' ';
    }
    return $postclass . weaverx_area_class('post', 'pad', '-tb', 'margin-bottom');
}