示例#1
0
/**
* Displays the secondary widget area
* Check if the widget area is active or if the default is set to home
* If neither is true, don't display the XHTML
*
* @since 0.2.2
*/
function hybrid_get_secondary()
{
    global $hybrid_settings;
    if ($hybrid_settings['secondary_inserts_default'] && is_sidebar_active(__('Secondary Home', 'hybrid')) && !is_page_template('no-widgets.php') || is_sidebar_active(hybrid_secondary_var()) && !is_page_template('no-widgets.php')) {
        ?>

		<div id="secondary">
		<?php 
        hybrid_before_secondary();
        // Before secondary hook
        if (dynamic_sidebar(hybrid_secondary_var())) {
        } else {
            if ($hybrid_settings['secondary_inserts_default']) {
                if (dynamic_sidebar(__('Secondary Home', 'hybrid'))) {
                }
            }
        }
        hybrid_after_secondary();
        // After secondary hook
        ?>
		</div>

	<?php 
    }
}
示例#2
0
function add_wicked_footer_aside()
{
    if (is_sidebar_active('footer-aside')) {
        echo thematic_before_widget_area('footer-aside');
        dynamic_sidebar('footer-aside');
        echo thematic_after_widget_area('footer-aside');
    }
}
示例#3
0
function vanilla_widget_block($block = null)
{
    $block = sanitize_title_with_dashes(strtolower($block));
    // Apply action
    do_action('vanilla_widget_' . str_replace('-', '_', $block) . '_before');
    if (function_exists('dynamic_sidebar') && is_sidebar_active($block)) {
        $tpl_source = '<metal:block define-macro="' . str_replace("-", "_", $block) . '">' . "\n" . "<!-- widget block: " . $block . " -->\n" . '<span tal:condition="php:VANILLA_DEBUG" class="widget-debug">' . $block . '</span>' . "\n";
        $tpl_source .= vanilla_widget_template_markup($block);
        $tpl_source .= '${php:vanilla_widget_block_wrapper(\'' . $block . '\')}' . "\n" . '</metal:block><metal:block use-macro="' . str_replace("-", "_", $block) . '" />' . "\n";
        //echo $tpl_source;
        echo "\t\t<div id=\"" . $block . "\" class=\"block\">\n";
        // Load and fire the PHPTAL template!
        ${$block} = new PHPTAL();
        global $tpl_set;
        ${$block}->setSource($tpl_source, $tpl_set . $block);
        vanilla_output_page(${$block});
        echo "</div>\n";
    }
    // Apply action
    do_action('vanilla_widget_' . str_replace('-', '_', $block) . '_after');
}
示例#4
0
?>

 <?php 
do_action('mystique_after_main');
?>

 <!-- footer -->
  <div id="footer">

 <?php 
$jquery = get_mystique_option('jquery');
// at least 1st footer area must have widgets
if (is_sidebar_active('footer-1')) {
    $sidebar2 = is_sidebar_active('footer-2');
    $sidebar3 = is_sidebar_active('footer-3');
    $sidebar4 = is_sidebar_active('footer-4');
    ?>

   <!-- blocks + slider -->
   <div id="footer-blocks" class="page-content <?php 
    if (($sidebar2 || $sidebar3 || $sidebar4) && $jquery) {
        echo 'withSlider';
    }
    ?>
">

    <?php 
    if (($sidebar2 || $sidebar3 || $sidebar4) && $jquery) {
        ?>
    <!-- block navigation -->
    <div class="slide-navigation">
示例#5
0
        the_content();
        ?>
</p>
    </section>
<?php 
    }
}
?>
</section>    

<!-- SIDEBAR RIGHT  -->
	<section id="sidebar" class="right" style="float:right;">
		<?php 
get_sidebar('right');
?>
	
	<?php 
if (is_sidebar_active('right')) {
    ?>
		<div id="sidebar_right">
 		<?php 
    dynamic_sidebar('right');
    ?>
		</div>
	<?php 
}
?>
	</section>

<?php 
get_footer();
示例#6
0
    if (is_sidebar_active('secondary-aside')) {
        ?>
    <div id="secondary" class="aside main-aside">
		<ul class="xoxo">
<?php 
        dynamic_sidebar('secondary-aside');
        ?>
		</ul>
	</div><!-- #secondary .aside -->
<?php 
    }
}
?>

<?php 
if (is_sidebar_active('1st-subsidiary-aside')) {
    ?>
	<div id="final" class="aside main-aside">
		<ul class="xoxo">
	<?php 
    dynamic_sidebar('1st-subsidiary-aside');
    ?>
		</ul>
	</div><!-- #primary .aside -->
<?php 
}
?>
	
   
<?php 
thematic_belowmainasides();
示例#7
0
<?php

if (is_sidebar_active('footer-one') || is_sidebar_active('footer-two')) {
    ?>
<div class="row pad_foot clearfix">
	<div class="row_inner">
		<!-- Widget 1 -->
		<div class="grid_6">
			<?php 
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('footer-one')) {
    }
    ?>
		</div>
			
		<!-- Widget 2 -->
		<div class="grid_6">
			<?php 
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('footer-two')) {
    }
    ?>
		</div>
	</div><!-- row inner -->
</div><!-- row -->
<?php 
}
			<?php 
sb_after_content();
?>
			
			<?php 
comments_template('', true);
?>

		</div><!-- #content -->
	</div><!-- #container -->

<?php 
$sidebar = 'tertiary_widget_area';
$location = 'tertiary';
if (is_sidebar_active($sidebar) || has_action("sb_no_{$sidebar}_widgets")) {
    ?>

		<?php 
    do_action("sb_before_{$location}_widgets");
    ?>
		<div id="<?php 
    echo $location;
    ?>
" class="aside <?php 
    echo $location;
    ?>
-aside<?php 
    if ($classes) {
        echo ' ' . $classes;
    }
	<?php 
if (function_exists('is_sidebar_active') && is_sidebar_active('region-right')) {
    ?>
        <section id="sidebar-right"><div id="sidebar-right-inner" class="region region-right">
          <?php 
    dynamic_sidebar('region-right');
    ?>
        </div></section> 
      <?php 
}
?>

    </div></div> 
	<div id="push"></div>
	</div></div>
    <footer id="footer"><div id="footer-inner" class="region region-footer">
		<?php 
if (function_exists('is_sidebar_active') && is_sidebar_active('region-footer')) {
    ?>
            <?php 
    dynamic_sidebar('region-footer');
    ?>
		<?php 
}
?>
   </div></footer> 
  <?php 
wp_footer();
?>
</body>
</html>
示例#10
0
function sb_do_secondary_widgets()
{
    if (is_sidebar_active('secondary_widget_area') || has_action('sb_no_secondary_widgets')) {
        ?>
		<div id="secondary" class="aside secondary-aside">
			<ul class="xoxo">

				<?php 
        if (!dynamic_sidebar('secondary-aside')) {
            sb_no_secondary_widgets();
        }
        ?>

			</ul>
		</div><!-- #secondary .aside -->
	<?php 
    }
}
<?php

if (is_sidebar_active('primary_widget_area')) {
    ?>
		<div id="primary" class="widget-area">
			<ul class="xoxo">
				<?php 
    dynamic_sidebar('primary_widget_area');
    ?>
			</ul>
		</div><!-- #primary .widget-area -->
<?php 
}
?>
		
		
<?php 
if (is_sidebar_active('secondary_widget_area')) {
    ?>
		<div id="secondary" class="widget-area">
			<ul class="xoxo">
				<?php 
    dynamic_sidebar('secondary_widget_area');
    ?>
			</ul>
		</div><!-- #secondary .widget-area -->
<?php 
}
?>
		
        ?>
		<?php 
    }
}
?>
  </div><!-- /#content -->
  <?php 
if (IS_MOBI == 'false') {
    ?>
    <div id="sidebar" class="grid_5 omega <?php 
    echo $sidebar;
    ?>
 region"><div id="sidebar_inner"> 
      <?php 
    if (function_exists('dynamic_sidebar')) {
        if (is_sidebar_active($sidebar)) {
            echo '<div id="' . $sidebar . '">';
            dynamic_sidebar($sidebar);
            echo '</div>';
        } else {
            ashford_hint('div', $sidebar, 'Activate the ' . $sidebar . ' by adding a widget.');
        }
    }
    ?>
    </div><!-- /#sidebar_inner -->
    <?php 
    ashford_outline_region(get_bloginfo('url') . '/wp-admin/widgets.php', 'Sidebar(s)', 'Activate this region by adding widgets to the sidebars.');
    ?>
    </div><!-- /#sidebar -->
  <?php 
}
function thematic_page_bottom()
{
    if (is_sidebar_active('page-bottom')) {
        echo thematic_before_widget_area('page-bottom');
        dynamic_sidebar('page-bottom');
        echo thematic_after_widget_area('page-bottom');
    }
}
示例#14
0
} else {
    ?>
                    <p id="blog-description"><?php 
    bloginfo('description');
    ?>
</p>
<?php 
}
?>
          
      </div>
      
      <!-- #masthead -->
<!-- #header_widget --><!--
<?php 
if (is_sidebar_active('header_widget')) {
    ?>
	<?php 
    dynamic_sidebar('header_widget');
    ?>
	<?php 
}
?>
-->
      <div id="search-wrapper">
     <form id="search" action="<?php 
bloginfo('url') . '/';
?>
" method="GET">
        <fieldset>
          <input type="hidden" name="domains" value="nmsu.edu" />
示例#15
0
<?php

if (is_sidebar_active('top_widget_area')) {
    ?>
           
    <div class="top-widget">
        <div class="ito-search-language">
            <div class="ito-search">
                <?php 
    if (is_widget_active('top_widget_area', 'search')) {
        ?>
                    <form id="searchform" method="get" action="<?php 
        bloginfo('home');
        ?>
">
                        <input type="text" name="s" id="s" value="" size="13" />
                    </form>
                <?php 
    }
    ?>

                <?php 
    if (is_widget_active('top_widget_area', 'polylang')) {
        the_language_menu(array('display_names_as' => 'slug'));
    }
    ?>
            </div>
        </div>
    </div>
<?php 
}
示例#16
0
<?php

if (is_sidebar_active('footer-one')) {
    ?>
	<div class="row pad_foot clearfix">
	<div class="row_inner">
		<!-- Widget 1 -->
		<div class="grid_12">
			<?php 
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('footer-one')) {
    }
    ?>
		</div>
	</div><!-- row inner -->
</div><!-- row -->
<?php 
}
function thematic_subsidiaryclose()
{
    if (is_sidebar_active('1st-subsidiary-aside') || is_sidebar_active('2nd-subsidiary-aside') || is_sidebar_active('3rd-subsidiary-aside')) {
        // one of the subsidiary asides has a widget
        ?>

			</div><!-- #subsidiary -->

		<?php 
    }
}
示例#18
0
文件: footer.php 项目: besimhu/legacy
?>

  </div>
  <!-- /side wrap -->
 </div>
 <!-- /mid column wrap -->
</div>
<!-- /main wrapper -->

<!-- clear main & sidebar sections -->
<div class="clearcontent"></div>
<!-- /clear main & sidebar sections -->

 <?php 
// check if we have widgets
if (is_sidebar_active('sidebar-3')) {
    ?>
  <!-- footer widgets -->
  <ul id="footer-widgets" class="widgetcount-<?php 
    $sidebars_widgets = wp_get_sidebars_widgets();
    $wcount = count($sidebars_widgets['sidebar-3']);
    print $wcount;
    ?>
">
  <?php 
    if (function_exists('dynamic_sidebar') && dynamic_sidebar('Footer')) {
    } else {
        ?>
  <?php 
    }
    ?>
        dynamic_sidebar('region-navbar');
        ?>
          <?php 
    }
    ?>
             
             
            </div></nav> 
          <?php 
}
?>

    <div id="main"><div id="main-inner" class="clearfix <?php 
print has_navbar();
?>
">
		<div id="content"><div id="content-inner">
			<?php 
if (function_exists('is_sidebar_active') && is_sidebar_active('region-content-top')) {
    ?>
		
				<div id="content-top" class="region region-content_top">
					<?php 
    dynamic_sidebar('region-content-top');
    ?>
				</div> <!-- /#content-top -->
			<?php 
}
?>
  
			<div id="content-area">
示例#20
0
    /**
     * Render markup and action hooks for a given sidebar (override this to customize your markup)
     *
     * @since StartBox 2.5
     * 
     * @param string $location the unique ID to give the container for this sidebar
     * @param string $sidebar the ID of the sidebar to attach to this location by default
     * @param string $classes additional custom classes to add to the container for this sidebar
     */
    function do_sidebar($location = null, $sidebar = null, $classes = null)
    {
        // Grab the stored post types and taxonomies that will display a custom sidebar
        $post_type = $this->get_custom_sidebars('post_type');
        $tax = $this->get_custom_sidebars('taxonomy');
        // Maybe replace the default sidebar with a custom sidebar
        $sidebar = $this->maybe_replace_current_sidebar($location, $sidebar);
        // If the sidebar has widgets, or an action attached to it, commence output
        if (is_sidebar_active($sidebar) || has_action("sb_no_{$sidebar}_widgets")) {
            ?>

			<?php 
            do_action("sb_before_{$location}");
            ?>
			<div id="<?php 
            echo $location;
            ?>
" class="aside <?php 
            echo $location;
            ?>
-aside<?php 
            if ($classes) {
                echo ' ' . $classes;
            }
            ?>
">
				<?php 
            do_action("sb_before_{$location}_widgets");
            ?>
				<ul class="xoxo">
					<?php 
            if (!dynamic_sidebar($sidebar)) {
                do_action("sb_no_{$sidebar}_widgets");
            }
            ?>
				</ul>
				<?php 
            do_action("sb_after_{$location}_widgets");
            ?>
		   </div><!-- #<?php 
            echo $location;
            ?>
 .aside-<?php 
            echo $location;
            ?>
 .aside -->
		   <?php 
            do_action("sb_after_{$location}");
            ?>
		
		<?php 
        }
    }
/**
 * Adds footer sidebar to #bottom (NOT MOBI)
 * 
 * @author Tim Bednar 
 * @version v2.0
 * @since v1.0
*/
function ashford_display_bottom()
{
    global $ashfordtheme;
    $ashford_display_bottom = $ashfordtheme->option['display_footer'];
    if ($ashford_display_bottom != 'footeroff' && function_exists('dynamic_sidebar') && IS_MOBI == 'false') {
        if (is_sidebar_active('footer')) {
            echo '<div id="bottom" class="region"><div id="bottom_inner">';
            dynamic_sidebar('footer');
            echo '</div><!-- /#bottom-inner-->';
            ashford_outline_region(get_bloginfo('url') . '/wp-admin/widgets.php', 'Bottom (footer)', __('Activate the footer by adding a widget.', 'ashford'));
            echo '</div><!-- /#bottom-->';
        } else {
            echo '<div id="bottom" class="region"><div id="bottom_inner">';
            ashford_hint('div', 'widget region', __('Activate the footer by adding a widget.', 'ashford'));
            echo '</div><!-- /#bottom-inner-->';
            ashford_outline_region(get_bloginfo('url') . '/wp-admin/widgets.php', 'Bottom (footer)', __('Activate the footer by adding a widget.', 'ashford'));
            echo '</div><!-- /#bottom-->';
        }
    }
}
示例#22
0
/**
* Dynamic body class based on page
*
* @since 0.1
*/
function hybrid_body_class()
{
    global $wp_query, $hybrid_settings;
    $class = array();
    if (is_front_page() || is_home()) {
        $class[] = 'home';
        $class[] = 'front-page';
    } elseif (is_attachment()) {
        global $post;
        $class[] = 'attachment';
        if (wp_attachment_is_image($post->ID)) {
            $class[] = 'attachment-image';
        }
        $mime = get_post_mime_type($post->ID);
        $class[] = 'attachment-' . str_replace('/', '-', $mime);
    } elseif (is_single()) {
        $class[] = 'single';
        $class[] = 'single-' . $wp_query->post->ID;
        if (function_exists('is_sticky')) {
            if (is_sticky($wp_query->post->ID)) {
                $class[] = 'single-sticky';
            }
        }
    } elseif (is_page()) {
        $class[] = 'page page-' . $wp_query->post->ID;
        if (is_page_template()) {
            $class[] = 'page-template';
            $class[] = 'page-template-' . str_replace('.php', '', get_post_meta($wp_query->post->ID, '_wp_page_template', true));
        }
    } elseif (is_category()) {
        $cat = $wp_query->get_queried_object();
        $class[] = 'category';
        $class[] = 'category-' . $cat->slug;
    } elseif (is_tag()) {
        $tags = $wp_query->get_queried_object();
        $class[] = 'tag';
        $class[] = 'tag-' . $tags->slug;
    } elseif (is_search()) {
        $class[] = 'search';
    } elseif (is_404()) {
        $class[] = 'error-404';
    } elseif (is_year()) {
        $class[] = 'year';
    } elseif (is_month()) {
        $class[] = 'month';
    } elseif (is_day()) {
        $class[] = 'day';
    } elseif (is_time()) {
        $class[] = 'time';
    } elseif (is_author()) {
        $author = $wp_query->get_queried_object();
        $class[] = 'author';
        $class[] = ' author-' . $author->user_nicename;
    }
    if (is_user_logged_in()) {
        $class[] = 'logged-in';
    } else {
        $class[] = 'not-logged-in';
    }
    if (is_date()) {
        $class[] = 'date';
    }
    if (is_archive()) {
        $class[] = 'archive';
    }
    if (is_paged()) {
        $class[] = 'paged';
    }
    if ((($page = $wp_query->get('paged')) || ($page = $wp_query->get('page'))) && $page > 1) {
        $class[] = 'paged';
        $class[] = 'paged-' . $page;
        if (is_home() || is_front_page()) {
            $class[] = 'home-paged-' . $page;
        } elseif (is_attachment()) {
            $class[] = 'attachment-paged-' . $page;
        } elseif (is_single()) {
            $class[] = 'single-paged-' . $page;
        } elseif (is_page()) {
            $class[] = 'page-paged-' . $page;
        } elseif (is_category()) {
            $class[] = 'category-paged-' . $page;
        } elseif (is_tag()) {
            $class[] = 'tag-paged-' . $page;
        } elseif (is_date()) {
            $class[] = 'date-paged-' . $page;
        } elseif (is_author()) {
            $class[] = 'author-paged-' . $page;
        } elseif (is_search()) {
            $class[] = 'search-paged-' . $page;
        }
    }
    if (is_comments_popup()) {
        $class[] = 'comments-popup';
    }
    if ($hybrid_settings['primary_inserts_default']) {
        if (!is_sidebar_active(__('Primary Home', 'hybrid')) && !is_sidebar_active(hybrid_primary_var())) {
            $class[] = 'no-primary-widgets';
            $no_primary_widgets = true;
        }
    } else {
        if (!is_sidebar_active(hybrid_primary_var())) {
            $class[] = 'no-primary-widgets';
            $no_primary_widgets = true;
        }
    }
    if ($hybrid_settings['secondary_inserts_default']) {
        if (!is_sidebar_active(__('Secondary Home', 'hybrid')) && !is_sidebar_active(hybrid_secondary_var())) {
            $class[] = 'no-secondary-widgets';
            $no_secondary_widgets = true;
        }
    } else {
        if (!is_sidebar_active(hybrid_secondary_var())) {
            $class[] = 'no-secondary-widgets';
            $no_secondary_widgets = true;
        }
    }
    if (is_page_template('no-widgets.php')) {
        $class[] = 'no-widgets';
        $no_widgets = true;
    }
    if ($no_widgets || $no_primary_widgets && $no_secondary_widgets) {
        $class[] = 'no-default-widgets';
    } else {
        $class[] = 'has-widgets';
    }
    $class = join(' ', $class);
    echo $class;
}
function sidebar_classes($classes)
{
    // add 'class-name' to the $classes array
    if (function_exists('is_sidebar_active') && is_sidebar_active('region-left')) {
        $side_left = true;
    }
    if (function_exists('is_sidebar_active') && is_sidebar_active('region-right')) {
        $side_right = true;
    }
    if ($side_left && $side_right) {
        $classes[] = 'two-sidebars';
    }
    if (!$side_left && $side_right) {
        $classes[] = 'one-sidebar';
        $classes[] = 'sidebar-right';
    }
    if ($side_left && !$side_right) {
        $classes[] = 'one-sidebar';
        $classes[] = 'sidebar-left';
    }
    // return the $classes array
    return $classes;
}
示例#24
0
        ?>
						<div id="MastheadSidebar-2">
							<div class="masthead-row widget-area">
								<div class="inner-wrapper">
									<?php 
        if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('horizontal-masthead-bottom')) {
        }
        ?>
								</div>
							</div>
						</div> <!-- / #MastheadSidebar-2 -->
					<?php 
    }
} else {
    // Sidebar for vertical masthead
    if (function_exists('is_sidebar_active') && is_sidebar_active('sidebar-masthead-bottom')) {
        ?>
						<div id="MastheadSidebar-2">
							<div class="masthead-row widget-area">
								<div class="inner-wrapper">
								<?php 
        if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar-masthead-bottom')) {
        }
        ?>
								</div>
							</div>
						</div> <!-- / #MastheadSidebar-2 -->
					<?php 
    }
}
?>
<?php

sb_before_tertiary_widgets();
?>

<?php 
if (is_sidebar_active('tertiary_widget_area') || has_action('sb_no_tertiary_widgets')) {
    ?>
	<div id="tertiary" class="aside tertiary-aside">
		<ul class="xoxo">
			<?php 
    if (!dynamic_sidebar('tertiary-aside')) {
        do_action('sb_no_tertiary_widgets');
    }
    ?>
		</ul>
	</div><!-- #tertiary .aside -->
<?php 
}
?>

<?php 
sb_after_tertiary_widgets();
示例#26
0
function ubuntu_loco_topbar()
{
    ?>
    <div id="top-bar">
        <?php 
    if (is_sidebar_active('top-bar-container')) {
        ?>
            <div class="top-bar-container">
                <div class="top-bar-container">
                    <ul>
                        <li><a href="http://www.ubuntu.com"><?php 
        _e('Ubuntu.com', 'light-wordpress-theme');
        ?>
</a></li>
                        <li><a href="http://www.ubuntu.com/community"><?php 
        _e('Community', 'light-wordpress-theme');
        ?>
</a></li>
                        <li><a href="http://www.ubuntu.com/support"><?php 
        _e('Support', 'light-wordpress-theme');
        ?>
</a></li>
                        <li><a href="http://www.ubuntu.com/partners"><?php 
        _e('Partners', 'light-wordpress-theme');
        ?>
</a></li>
                    </ul>
                </div>
            </div>
        <?php 
    }
    ?>
    </div>
<?php 
}
<div class="side-bar">
    <?php 
if (is_sidebar_active('primary_widget_area')) {
    ?>
        <div class="widget-area">
            <ul class="widget-area-list">
                <?php 
    dynamic_sidebar('primary_widget_area');
    ?>
            </ul>
        </div>
    <?php 
}
?>
       
</div>
示例#28
0
/**
 * Provides classes for the <body> element depending on page context.
 *
 * @since 0.1
 * @uses $wp_query
 * @param string|array $class Additional classes for more control.
 * @return string
 */
function rolopress_body_class($class = '')
{
    global $wp_query, $is_lynx, $is_gecko, $is_firefox, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome;
    /* Text direction (which direction does the text flow). */
    $classes = array('rolopress', get_bloginfo('text_direction'), get_locale());
    /* Date classes. */
    $time = time() + get_option('gmt_offset') * 3600;
    foreach (array('Y', 'm', 'd', 'H', 'l') as $type) {
        $classes[] = str_replace('l', '', strtolower($type . gmdate($type, $time)));
    }
    /* Is the current user logged in. */
    $classes[] = is_user_logged_in() ? 'logged-in' : 'not-logged-in';
    /* Can the current user edit items. */
    if (current_user_can('edit_posts')) {
        $classes[] = 'can-edit-items';
    }
    /* Can the current user add items. */
    if (current_user_can('publish_posts')) {
        $classes[] = 'can-add-items';
    }
    /* Merge base contextual classes with $classes. */
    $classes = array_merge($classes, rolopress_get_context());
    /* Singular post (post_type) classes. */
    if (is_singular()) {
        /* Checks for custom template. */
        $template = str_replace('.php', '', get_post_meta($wp_query->post->ID, "_wp_{$wp_query->post->post_type}_template", true));
        if ($template) {
            $classes[] = "{$wp_query->post->post_type}-template-{$template}";
        }
        /* Attachment mime types. */
        if (is_attachment()) {
            foreach (explode('/', get_post_mime_type()) as $type) {
                $classes[] = "attachment-{$type}";
            }
        } elseif (is_page()) {
            $classes[] = "page-{$wp_query->post->ID}";
        } elseif (is_single()) {
            $classes[] = "single-{$wp_query->post->ID}";
        }
        // Use singular-post-ID
    }
    /* Paged views. */
    if ((($page = $wp_query->get('paged')) || ($page = $wp_query->get('page'))) && $page > 1) {
        $page = intval($page);
        $classes[] = 'paged paged-' . $page;
    }
    /* Browser detection. */
    // A little Browser detection shall we?
    $browser = $_SERVER['HTTP_USER_AGENT'];
    // Mac, PC ...or Linux
    if (preg_match("/Mac/", $browser)) {
        $classes[] = 'mac';
    } elseif (preg_match("/Windows/", $browser)) {
        $classes[] = 'windows';
    } elseif (preg_match("/Linux/", $browser)) {
        $classes[] = 'linux';
    } else {
        $classes[] = 'unknown-os';
    }
    // Checks browsers in this order: Chrome, Safari, Opera, MSIE, FF
    if (preg_match("/Chrome/", $browser)) {
        $classes[] = 'chrome';
        preg_match("/Chrome\\/(\\d.\\d)/si", $browser, $matches);
        $ch_version = 'ch' . str_replace('.', '-', $matches[1]);
        $classes[] = $ch_version;
    } elseif (preg_match("/Safari/", $browser)) {
        $classes[] = 'safari';
        preg_match("/Version\\/(\\d.\\d)/si", $browser, $matches);
        $sf_version = 'sf' . str_replace('.', '-', $matches[1]);
        $classes[] = $sf_version;
    } elseif (preg_match("/Opera/", $browser)) {
        $classes[] = 'opera';
        preg_match("/Opera\\/(\\d.\\d)/si", $browser, $matches);
        $op_version = 'op' . str_replace('.', '-', $matches[1]);
        $classes[] = $op_version;
    } elseif (preg_match("/MSIE/", $browser)) {
        $classes[] = 'msie';
        if (preg_match("/MSIE 6.0/", $browser)) {
            $classes[] = 'ie6';
        } elseif (preg_match("/MSIE 7.0/", $browser)) {
            $classes[] = 'ie7';
        } elseif (preg_match("/MSIE 8.0/", $browser)) {
            $classes[] = 'ie8';
        }
    } elseif (preg_match("/Firefox/", $browser) && preg_match("/Gecko/", $browser)) {
        $classes[] = 'firefox';
        preg_match("/Firefox\\/(\\d)/si", $browser, $matches);
        $ff_version = 'ff' . str_replace('.', '-', $matches[1]);
        $classes[] = $ff_version;
    } else {
        $classes[] = 'unknown-browser';
    }
    /* rolopress theme widgets detection. */
    // Need to handle better.  Widget areas register as active if they contain smart widgets, even if the widgets are not visible
    if (is_singular()) {
        /* Detect widgets in single page widget areas */
        foreach (array('contact-under-main', 'company-under-main') as $sidebar) {
            $classes[] = is_sidebar_active($sidebar) ? "{$sidebar}-widgets-active" : "{$sidebar}-widgets-inactive";
        }
    }
    if (is_page_template('widgets.php' || 'widgets-no-sidebar.php')) {
        /* Detect widgets on widget template pages */
        foreach (array('widget-page') as $sidebar) {
            $classes[] = is_sidebar_active($sidebar) ? "{$sidebar}-widgets-active" : "{$sidebar}-widgets-inactive";
        }
    }
    foreach (array('menu', 'primary', 'secondary') as $sidebar) {
        /* Detect widgets everywhere else */
        $classes[] = is_sidebar_active($sidebar) ? "{$sidebar}-widgets-active" : "{$sidebar}-widgets-inactive";
    }
    /* Input class. */
    if (!empty($class)) {
        if (!is_array($class)) {
            $class = preg_split('#\\s+#', $class);
        }
        $classes = array_merge($classes, $class);
    }
    /* Join all the classes into one string. */
    $class = join(' ', $classes);
    /* Print the body class. */
    echo apply_filters('body_class', $class);
}
示例#29
0
?>
" title="RSS 2.0 feed">RSS 2.0 feed</a></li>
          <li><a href="<?php 
bloginfo('atom_url');
?>
" title="Atom feed">Atom feed</a></li>
        </ul>
        </div>
        
        
      </div>
    <!-- content-in #end -->
    
    <div id="sidebar" class="grid_4 sidebar_left fl">
     <?php 
if (function_exists('dynamic_sidebar') && is_sidebar_active(13)) {
    // Show on the front page
    ?>
				<?php 
    dynamic_sidebar(13);
    ?>
  
         <?php 
}
?>
  	
    </div> <!-- Left sidebar -->
	</div> <!-- page #end -->
</div><!-- wrapper #end -->
 <?php 
get_footer();
示例#30
0
 *
 * Shared by: page.php, single.php, 404.php, search.php
 * Shared by: page_archives.php, page_faq.php, page_toc.php
 *
 * v0.7 - Added to ashford code in v0.7
 * v0.7 - Added php comments
 * v0.7 - Internationalized
 * v0.7 - Refactored meta sections
 * v0.7 - Removed logic check for if page();
 * 
 * @author Tim Bednar 
 * @version v1.0
 * @todo place hooks so it is easy to move meta sections: cat/tag list, author box, share icons and related posts.
*/
?>
<div id="sidebar" class="grid_5 suffix_1 omega sidebar_right region">
  <div id="sidebar_inner"> 
    <?php 
if (function_exists('dynamic_sidebar')) {
    if (is_sidebar_active('sidebar_standard')) {
        dynamic_sidebar('sidebar_standard');
    } else {
        ashford_hint('div', 'sidebar', __('Activate the Standard Sidebar by adding a widget.', 'ashford'));
    }
}
?>
  </div><!-- /#sidebar_inner -->
  <?php 
ashford_outline_region(get_bloginfo('url') . '/wp-admin/widgets.php', 'Sidebar(s)', 'Activate this region by adding widgets to the sidebars.');
?>
</div><!-- /#sidebar -->