예제 #1
0
function suffusion_print_sidebar($index, $css_id, $name, $sidebar_style, $sidebar_alignment)
{
    if ($sidebar_style == 'tabbed') {
        $css_class = "tabbed-sidebar tab-box-{$sidebar_alignment} {$sidebar_alignment} fix";
        $tabbed = true;
    } else {
        $css_class = "dbx-group {$sidebar_alignment} {$sidebar_style}";
        $tabbed = false;
    }
    if (!suffusion_is_sidebar_empty($index)) {
        ?>
		<!-- #<?php 
        echo $css_id;
        ?>
 -->
		<div id="<?php 
        echo $css_id;
        ?>
" class="<?php 
        echo $css_class;
        ?>
 warea">
<?php 
        if ($tabbed) {
            ?>
		<ul  class="sidebar-tabs">
<?php 
        }
        dynamic_sidebar($name);
        if ($tabbed) {
            ?>
		</ul>
<?php 
        }
        ?>
		</div>
		<!-- /#<?php 
        echo $css_id;
        ?>
 -->
<?php 
    }
}
예제 #2
0
<?php

/**
 * Displays the Widget Area Above Footer. This sidebar can be overridden in child themes by creating a file of the same name.
 *
 * @since 3.8.4
 * @package Suffusion
 * @subpackage Sidebars
 */
if (!suffusion_is_sidebar_empty(12)) {
    ?>
	<!-- #header-widgets -->
	<div id="header-widgets" class="warea">
<?php 
    dynamic_sidebar('Header Widgets');
    ?>
	</div>
	<!-- /#header-widgets -->
<?php 
}
예제 #3
0
<?php

/**
 * Displays the "Left Header Widgets". This sidebar can be overridden in child themes by creating a file of the same name.
 *
 * @since 3.8.4
 * @package Suffusion
 * @subpackage Sidebars
 */
if (!suffusion_is_sidebar_empty('8')) {
    ?>
	<!-- left-header-widgets -->
	<div id="left-header-widgets" class='warea fix'>
	<?php 
    dynamic_sidebar('Left Header Widgets');
    ?>
	</div>
	<!-- /left-header-widgets -->
<?php 
}
예제 #4
0
<div id="main-col">
<?php 
suffusion_before_begin_content();
?>
	<div id="content" class='hfeed content'>
		<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        global $post;
        $hide_title = suffusion_get_post_meta($post->ID, "suf_hide_page_title", true);
        if (!$hide_title) {
            the_title("<h1 class='cl-title'>", "</h1>");
        }
        for ($i = 1; $i <= 5; $i++) {
            if (!suffusion_is_sidebar_empty('sidebar-cl-' . $i)) {
                $default_cols = "suf_clt_wa{$i}_cols";
                $default_height = "suf_clt_wa{$i}_widget_height";
                $default_skinning = "suf_clt_wa{$i}_skin_setting";
                global ${$default_cols}, ${$default_height}, ${$default_skinning};
                $cols = suffusion_get_post_meta($post->ID, "suf_cpt_wa{$i}_cols", true);
                if ($cols == '') {
                    $cols = ${$default_cols};
                }
                $widget_height = suffusion_get_post_meta($post->ID, "suf_cpt_wa{$i}_widget_height", true);
                if ($widget_height == '') {
                    $widget_height = ${$default_height};
                }
                $custom = '';
                if (${$default_skinning}) {
                    $custom = 'custom-skin';
예제 #5
0
/**
 * Displays all right sidebars. This shows the following:
 *  1. Static tabbed sidebar, if enabled and either explicitly positioned right or if positioned left but there are no left sidebars.
 *  2. A wide sidebar at the top, if there are 2 right sidebars
 *  3. Sidebar 1 & Sidebar 1 - bottom, if applicable
 *  4. Sidebar 2 & Sidebar 2 - bottom, if applicable
 *  5. A wide sidebar at the bottom, if there are 2 right sidebars.
 *
 * @return
 */
function suffusion_print_right_sidebars()
{
    global $suffusion;
    wp_reset_postdata();
    if (!isset($suffusion) || is_null($suffusion)) {
        $suffusion = new Suffusion();
    }
    $context = $suffusion->get_context();
    $right_count = suffusion_get_right_sidebar_count($context);
    if ($right_count == 0) {
        return;
    }
    global $suf_sidebar_alignment, $suf_sbtab_alignment, $suffusion_tabs_alignment, $suf_sbtab_enabled, $suf_wa_sb1b_style, $suf_wa_sb2b_style, $suf_wa_wst_style, $suf_wa_wsb_style;
    $left_count = suffusion_get_left_sidebar_count($context);
    // Show static tabbed sidebar if it is enabled:
    //  1. And positioned on the right
    //  2. Or there is only one sidebar and that is to the right
    //  3. Or there are 2 right sidebars.
    if ($suf_sbtab_enabled == 'enabled' && ($suf_sbtab_alignment == 'right' || $right_count == 1 && $left_count == 0 || $right_count == 2)) {
        echo "<div id='sidebar-container' class='sidebar-container-right fix'>";
        $suffusion_tabs_alignment = 'right';
        get_sidebar('tabs');
    }
    // Show Wide Sidebar Top if there are 2 right sidebars
    if ($right_count == 2) {
        echo "<div id='sidebar-wrap' class='sidebar-wrap sidebar-wrap-right fix'>";
        if (!suffusion_is_sidebar_empty(18)) {
            suffusion_print_sidebar(18, 'wsidebar-top', 'Wide Sidebar (Top)', $suf_wa_wst_style, 'right');
        }
    }
    // Show Sidebar-1 if:
    //  1. There is only 1 sidebar to be shown and that's on the right
    //  2. Or there are 2 sidebars to be shown, one on the left and one on the right, and sidebar-1 has right alignment
    //  3. Or there are 2 sidebars to be shown, both on the right
    if ($right_count == 1 && $left_count == 0 || $right_count == 1 && $left_count == 1 && $suf_sidebar_alignment == 'right' || $right_count == 2) {
        echo "<div id='sidebar-shell-1' class='sidebar-shell sidebar-shell-right'>\n";
        suffusion_before_first_sidebar();
        get_sidebar();
        suffusion_between_first_sidebars();
        suffusion_print_sidebar(9, 'sidebar-b', 'Sidebar 1 (Bottom)', $suf_wa_sb1b_style, "right");
        suffusion_after_first_sidebar();
        echo "</div>\n";
    }
    // Show Sidebar-2 if:
    //  1. There is 1 sidebar on the left and one on the right, and sidebar-2 has right alignment
    //  2. Or there are 2 sidebars to be shown, both on the right
    if ($right_count == 1 && $left_count == 1 && $suf_sidebar_alignment == "left" || $right_count == 2) {
        echo "<div id='sidebar-shell-2' class='sidebar-shell sidebar-shell-right'>\n";
        suffusion_before_second_sidebar();
        get_sidebar(2);
        suffusion_between_second_sidebars();
        suffusion_print_sidebar(10, 'sidebar-2-b', 'Sidebar 2 (Bottom)', $suf_wa_sb2b_style, "right");
        suffusion_after_second_sidebar();
        echo "</div>\n";
    }
    // Show Wide Sidebar Bottom if there are 2 right sidebars. Consequently close #sidebar-wrap.
    if ($right_count == 2) {
        if (!suffusion_is_sidebar_empty(19)) {
            suffusion_print_sidebar(19, 'wsidebar-bottom', 'Wide Sidebar (Bottom)', $suf_wa_wsb_style, 'right');
        }
        echo "</div>";
    }
    // Close container, created if there is a static tabbed sidebar.
    if ($suf_sbtab_enabled == 'enabled' && ($suf_sbtab_alignment == 'right' || $right_count == 1 && $left_count == 0 || $right_count == 2)) {
        echo "</div> <!-- /#sidebar-container -->";
    }
}
예제 #6
0
/**
 * Prints a mega menu corresponding to a menu tab. This essentially prints out the widget area associated with the menu tab.
 * Mega-menus are not applicable to any tab that is not at a root-level
 *
 * @param $item_output
 * @param $item
 * @param $depth
 * @param $args
 * @return string
 */
function suffusion_mega_menu_walker($item_output, $item, $depth, $args)
{
    if ($depth == 0 && isset($args->walker)) {
        // If we don't check for the walker, the widget areas start affecting the "Custom Menu" widgets too.
        // The Walker is associated only with the drop-downs, hence we verify before printing the widget areas
        if (class_exists('Suffusion_MM_Walker') && is_a($args->walker, 'Suffusion_MM_Walker')) {
            $warea = suffusion_get_post_meta($item->ID, 'suf_mm_warea', true);
            if (isset($warea) && $warea != '' && !suffusion_is_sidebar_empty($warea)) {
                ob_start();
                // Need output buffering here, otherwise we cannot print the widget area in the menu.
                $cols = suffusion_get_post_meta($item->ID, 'suf_mm_cols');
                if ($cols == '' || $cols == 0 || $cols == '0') {
                    $cols = 5;
                }
                $widget_height = suffusion_get_post_meta($item->ID, 'suf_mm_widget_height');
                if ($widget_height) {
                    $mason_class = 'mm-' . $widget_height;
                } else {
                    $mason_class = 'mm-row-equal';
                }
                echo "<div class='mm-warea mm-warea-{$cols} mm-warea-{$item->ID}'>\n";
                echo "<div class='{$mason_class} mm-row-{$cols}'>\n";
                dynamic_sidebar('sidebar-' . $warea);
                echo "</div>\n";
                echo "</div>\n";
                $content = ob_get_contents();
                ob_end_clean();
                return $item_output . $content;
            }
        }
    }
    return $item_output;
}
 function get_custom_header_settings()
 {
     global $suf_header_style_setting, $suf_header_image_type, $suf_header_background_image, $suf_header_background_rot_folder, $suf_header_background_repeat;
     global $suf_header_background_position, $suf_header_section_height, $suf_header_height, $suf_header_gradient_start_color, $suf_header_gradient_end_color, $suf_header_gradient_style;
     global $suf_blog_title_color, $suf_blog_title_style, $suf_blog_title_hover_color, $suf_blog_title_hover_style, $suf_blog_description_color, $suf_sub_header_vertical_alignment;
     global $suf_header_alignment, $suf_sub_header_alignment, $suf_wih_width;
     $ret = "";
     if ($suf_header_style_setting == "custom") {
         if ($suf_header_image_type == "image" && isset($suf_header_background_image) && trim($suf_header_background_image) != '' || $suf_header_image_type == "rot-image" && isset($suf_header_background_rot_folder) && trim($suf_header_background_rot_folder) != '') {
             if ($suf_header_image_type == "image") {
                 $header_bg_url = " url({$suf_header_background_image}) ";
             } else {
                 $header_bg_url = " url(" . suffusion_get_rotating_image($suf_header_background_rot_folder) . ") ";
             }
             $ret .= "\r\n#header-container {\tbackground-image: {$header_bg_url}; background-repeat: {$suf_header_background_repeat}; background-position: {$suf_header_background_position}; height: {$suf_header_section_height}; }";
         } else {
             if ($suf_header_image_type == "gradient") {
                 if (isset($suf_header_height)) {
                     $header_bg_url = " url(" . get_template_directory_uri() . "/gradient.php?start={$suf_header_gradient_start_color}&finish={$suf_header_gradient_end_color}&direction={$suf_header_gradient_style}&height={$suf_header_height})";
                 } else {
                     $header_bg_url = " url(" . get_template_directory_uri() . "/gradient.php?start={$suf_header_gradient_start_color}&finish={$suf_header_gradient_end_color}&direction={$suf_header_gradient_style}&height=121)";
                 }
                 if ($suf_header_gradient_style == "top-down" || $suf_header_gradient_style == "down-top") {
                     $header_bg_repeat = "repeat-x";
                 } else {
                     if ($suf_header_gradient_style == "left-right" || $suf_header_gradient_style == "right-left") {
                         $header_bg_repeat = "repeat-y";
                     }
                 }
                 if ($suf_header_gradient_style == "top-down" || $suf_header_gradient_style == "left-right") {
                     $header_bg_color = $suf_header_gradient_end_color;
                 } else {
                     if ($suf_header_gradient_style == "down-top" || $suf_header_gradient_style == "right-left") {
                         $header_bg_color = $suf_header_gradient_start_color;
                     }
                 }
                 $ret .= "\r\n#header-container { background-image: {$header_bg_url}; background-repeat: {$header_bg_repeat}; background-color: #" . $this->strip_color_hash($header_bg_color) . "; }";
             }
         }
         $ret .= "\r\n.blogtitle a { color: #" . $this->strip_color_hash($suf_blog_title_color) . "; text-decoration: {$suf_blog_title_style}; }\r\n.custom-header .blogtitle a:hover { color: #" . $this->strip_color_hash($suf_blog_title_hover_color) . "; text-decoration: {$suf_blog_title_hover_style}; }\r\n.description { color: #" . $this->strip_color_hash($suf_blog_description_color) . "; }";
         if (isset($suf_header_height)) {
             $header_height = suffusion_admin_get_size_from_field($suf_header_height, "55px");
             $ret .= "\r\n#header { min-height: {$header_height}; }";
         }
     }
     if ($suf_sub_header_vertical_alignment == "above" || $suf_sub_header_vertical_alignment == "below") {
         $ret .= "\r\n.description { display: block; width: 100%; margin-top: 0; margin-left: 0; margin-right: 0; }\r\n.blogtitle { width: 100%; }";
     }
     if ($suf_header_alignment == "center") {
         $ret .= "\r\n#header { text-align: center; }";
     }
     // If there are header widgets then the width of the header needs to be balanced
     if (!suffusion_is_sidebar_empty(12)) {
         $wih_width = suffusion_admin_get_size_from_field($suf_wih_width, "300px");
         if ($suf_header_alignment != 'right') {
             $ret .= "\r\n#header { float: left; width: auto; }\r\n#header .blogtitle, #header .description { float: none; }\r\n#header-widgets { float: right; width: {$wih_width}; }";
         } else {
             $ret .= "\r\n#header { float: right; width: auto; }\r\n#header .blogtitle, #header .description { float: none; }\r\n#header-widgets { float: left; width: {$wih_width}; }";
         }
     }
     return $ret;
 }
<?php

/**
 * Displays the "Right Header Widgets". This sidebar can be overridden in child themes by creating a file of the same name.
 *
 * @since 3.8.4
 * @package Suffusion
 * @subpackage Sidebars
 */
global $suf_show_search;
if ($suf_show_search == "show" || !suffusion_is_sidebar_empty(3)) {
    ?>
	<!-- right-header-widgets -->
	<div id="right-header-widgets" class="warea">
	<?php 
    if (!dynamic_sidebar('Right Header Widgets')) {
        global $suffusion_rhw_is_not_dynamic;
        $suffusion_rhw_is_not_dynamic = true;
        if ($suf_show_search == "show") {
            get_search_form();
        }
        $suffusion_rhw_is_not_dynamic = false;
    }
    ?>
	</div>
	<!-- /right-header-widgets -->
<?php 
}