Example #1
0
function enlightenment_unlimited_sidebars_print_theme_css($output)
{
    $sidebars = enlightenment_registered_sidebars();
    $defaults = enlightenment_registered_sidebars_default_atts();
    $default_bg = $defaults['widgets_background_color'];
    foreach ($sidebars as $sidebar => $atts) {
        if ($default_bg != $atts['widgets_background_color']) {
            $output .= sprintf(".custom-%s .widget {\n", $sidebar);
            $output .= "\tpadding-left: 20px;\n";
            $output .= "\tpadding-right: 20px;\n";
            $output .= "\tmargin-top: 15px;\n";
            $output .= "\tmargin-bottom: 15px;\n";
            $output .= "\tborder-radius: 2px;\n";
            $output .= "}\n";
        }
        if ('parallax' == $atts['background']['scroll']) {
            $output .= sprintf(".custom-%s {\n", $sidebar);
            $output .= "\tposition: relative;\n";
            $output .= "\toverflow: hidden;\n";
            $output .= "}\n";
        }
    }
    return $output;
}
function enlightenment_sidebar_heading($args = null)
{
    $defaults = array('container' => 'header', 'container_class' => 'sidebar-heading', 'container_id' => '', 'container_extra_atts' => '', 'sidebar_title_tag' => 'h2', 'sidebar_title_class' => 'sidebar-title', 'sidebar_title_id' => '', 'sidebar_title_extra_atts' => '', 'sidebar_description_tag' => 'div', 'sidebar_description_class' => 'sidebar-description', 'sidebar_description_id' => '', 'sidebar_description_extra_atts' => '', 'echo' => true);
    $defaults = apply_filters('enlightenment_sidebar_header_args', $defaults);
    $args = wp_parse_args($args, $defaults);
    $locations = enlightenment_sidebar_locations();
    $template = enlightenment_current_sidebars_template();
    $location = enlightenment_current_sidebar_name();
    $sidebars = enlightenment_registered_sidebars();
    $sidebar = $sidebars[$locations[$template][$location]['sidebar']];
    $sidebar_title = apply_filters('enlightenment_sidebar_title', $sidebar['name']);
    $sidebar_description = apply_filters('enlightenment_sidebar_description', $sidebar['description']);
    if (!$sidebar['display_title'] && !$sidebar['display_description']) {
        return;
    }
    $output = enlightenment_open_tag($args['container'], $args['container_class'], $args['container_id'], $args['container_extra_atts']);
    if ($sidebar['display_title']) {
        $output .= enlightenment_open_tag($args['sidebar_title_tag'], $args['sidebar_title_class'], $args['sidebar_title_id'], $args['sidebar_title_extra_atts']);
        $output .= $sidebar_title;
        $output .= enlightenment_close_tag($args['sidebar_title_tag']);
    }
    if ($sidebar['display_description'] && !empty($sidebar_description)) {
        $output .= enlightenment_open_tag($args['sidebar_description_tag'], $args['sidebar_description_class'], $args['sidebar_description_id'], $args['sidebar_description_extra_atts']);
        $output .= $sidebar_description . "\n";
        $output .= enlightenment_close_tag($args['sidebar_description_tag']);
    }
    $output .= enlightenment_close_tag($args['container']);
    $output = apply_filters('enlightenment_sidebar_header', $output, $args);
    if (!$args['echo']) {
        return $output;
    }
    echo $output;
}