本文整理汇总了PHP中Roots\Sage\Setup\display_sidebar函数的典型用法代码示例。如果您正苦于以下问题:PHP display_sidebar函数的具体用法?PHP display_sidebar怎么用?PHP display_sidebar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_sidebar函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TimberMenu
function add_to_context($context)
{
/* Add extra data */
$context['foo'] = 'I am some other typical value set in your functions.php file, unrelated to the menu';
/* Menu */
$context['menu'] = new TimberMenu('primary_navigation');
/* Site info */
$context['site'] = $this;
/* Site info */
$context['display_sidebar'] = Setup\display_sidebar();
$context['sidebar_primary'] = Timber::get_widgets('sidebar-primary');
return $context;
}
示例2: body_class
/**
* Add <body> classes
*/
function body_class($classes)
{
// Add page slug if it doesn't exist
if (is_single() || is_page() && !is_front_page()) {
if (!in_array(basename(get_permalink()), $classes)) {
$classes[] = basename(get_permalink());
}
}
// Add class if sidebar is active
if (Setup\display_sidebar()) {
$classes[] = 'sidebar-primary';
}
return $classes;
}
示例3: body_class
/**
* Add <body> classes
*/
function body_class($classes)
{
// Add page slug if it doesn't exist
if (is_single() || is_page() && !is_front_page()) {
if (!in_array(basename(get_permalink()), $classes)) {
$classes[] = basename(get_permalink());
}
}
if (!is_home() && 'area-skin-care' != get_post_type() && __('osmin-linea-pediatrica', 'sage') !== basename(get_permalink()) || is_search()) {
$classes[] = 'no-full-slider';
}
// Add class if sidebar is active
if (Setup\display_sidebar()) {
$classes[] = 'sidebar-primary';
}
return $classes;
}
示例4: body_class
/**
* Add <body> classes
*/
function body_class($classes)
{
// Add page slug if it doesn't exist
if (is_single() || is_page() && !is_front_page()) {
if (!in_array(basename(get_permalink()), $classes)) {
$classes[] = basename(get_permalink());
}
}
// Add post has featured image class
if (is_singular() && has_post_thumbnail($post->ID)) {
$classes[] = 'feature-image';
}
// Add class if sidebar is active
if (Setup\display_sidebar()) {
$classes[] = 'sidebar-primary';
}
return $classes;
}
示例5: body_class
/**
* Add <body> classes
*/
function body_class($classes)
{
// Add page slug if it doesn't exist
if (is_single() || is_page() && !is_front_page()) {
if (!in_array(basename(get_permalink()), $classes)) {
$classes[] = basename(get_permalink());
}
}
// Add class if sidebar is active
if (Setup\display_sidebar()) {
$classes[] = 'sidebar-primary';
}
// Add a class if using a navbar-fixed-top
if (current_theme_supports('navbarfixed-top')) {
$classes[] = 'navbar-fixed-top-body';
}
return $classes;
}
示例6: body_class
/**
* Add <body> classes
*/
function body_class($classes)
{
// Add page slug if it doesn't exist
if (is_single() || is_page() && !is_front_page()) {
if (!in_array(basename(get_permalink()), $classes)) {
$classes[] = basename(get_permalink());
}
}
// Add class if sidebar is active
if (Setup\display_sidebar()) {
$classes[] = 'sidebar-primary';
}
// Add class if post has thumbnails
if (current_theme_supports('post-thumbnails')) {
if (!has_post_thumbnail()) {
$classes[] = 'no-thumbnail';
}
}
return $classes;
}
示例7:
} else {
?>
<!-- for other article -->
<div class="col-md-8"> <!-- main post -->
<main>
<?php
include Wrapper\template_path();
?>
</main><!-- /.main -->
</div>
<div class="col-md-4"> <!-- side bar -->
<?php
if (Setup\display_sidebar()) {
?>
<aside>
<?php
include Wrapper\sidebar_path();
?>
</aside>
<?php
}
?>
</div>
<?php
}
?>