예제 #1
0
 function hoot_page_header_attop()
 {
     $full = array_map('trim', explode(',', hoot_get_mod('page_header_full')));
     /* Override For Full Width Pages (including 404 page) */
     if (in_array('no-sidebar', $full)) {
         $sidebar_size = hoot_main_layout('primary-sidebar');
         if (empty($sidebar_size) || hoot_is_404()) {
             return apply_filters('hoot_page_header_attop', true, 'no-sidebar');
         }
     }
     /* For Posts */
     if (is_singular('post')) {
         if (in_array('posts', $full)) {
             return apply_filters('hoot_page_header_attop', true, 'posts');
         } else {
             return apply_filters('hoot_page_header_attop', false, 'posts');
         }
     }
     /* For Pages */
     if (is_page()) {
         if (in_array('pages', $full)) {
             return apply_filters('hoot_page_header_attop', true, 'pages');
         } else {
             return apply_filters('hoot_page_header_attop', false, 'pages');
         }
     }
     /* Default */
     if (in_array('default', $full)) {
         return apply_filters('hoot_page_header_attop', true, 'default');
     } else {
         return apply_filters('hoot_page_header_attop', false, 'default');
     }
 }
예제 #2
0
/**
 * Utility function to determine the location of page header
 *
 * @since 1.0
 * @access public
 */
function hoot_page_header_attop()
{
    $full = wp_parse_args(hoot_get_option('page_header_full'), array('default' => '1', 'posts' => 0, 'pages' => '1', 'no-sidebar' => '1'));
    /* Override For Full Width Pages (including 404 page) */
    if ($full['no-sidebar']) {
        $sidebar_size = hoot_main_layout('primary-sidebar');
        if (empty($sidebar_size) || hoot_is_404()) {
            return apply_filters('hoot_page_header_attop', true);
        }
    }
    /* For Posts */
    if (is_singular('post')) {
        if ($full['posts']) {
            return apply_filters('hoot_page_header_attop', true);
        } else {
            return apply_filters('hoot_page_header_attop', false);
        }
    }
    /* For Pages */
    if (is_page()) {
        if ($full['pages']) {
            return apply_filters('hoot_page_header_attop', true);
        } else {
            return apply_filters('hoot_page_header_attop', false);
        }
    }
    /* Default */
    if ($full['default']) {
        return apply_filters('hoot_page_header_attop', true);
    } else {
        return apply_filters('hoot_page_header_attop', false);
    }
}
예제 #3
0
<?php

// Dispay Sidebar if not a one-column layout
$sidebar_size = hoot_main_layout('primary-sidebar');
if (!empty($sidebar_size)) {
    ?>

	<aside <?php 
    hoot_attr('sidebar', 'primary');
    ?>
>

		<?php 
    // Template modification Hook
    do_action('hoot_template_sidebar_start', 'shop');
    if (is_active_sidebar('woocommerce-sidebar')) {
        // If the sidebar has widgets.
        dynamic_sidebar('woocommerce-sidebar');
        // Displays the woocommerce sidebar.
    } else {
        // If the sidebar has no widgets.
        the_widget('WP_Widget_Text', array('title' => __('Woocommerce Sidebar', 'chromatic'), 'text' => sprintf(__('Woocommerce pages have a separate sidebar than the rest of your site. You can add custom widgets from the %swidgets screen%s in the admin.', 'chromatic'), current_user_can('edit_theme_options') ? '<a href="' . admin_url('widgets.php') . '">' : '', current_user_can('edit_theme_options') ? '</a>' : ''), 'filter' => true), array('before_widget' => '<section class="widget widget_text">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    }
    // End widgets check.
    // Template modification Hook
    do_action('hoot_template_sidebar_start', 'shop');
    ?>

	</aside><!-- #sidebar-primary -->

<?php 
예제 #4
0
/**
 * Wrapper function for hoot_main_layout() to get the class names for current context.
 * Can only be used after 'posts_selection' action hook i.e. in 'wp' hook or later.
 *
 * @since 1.0
 * @access public
 * @param string $context content|primary-sidebar|sidebar|sidebar-primary
 * @return string
 */
function hoot_main_layout_class($context)
{
    return hoot_main_layout($context, 'class');
}