• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_active_sidebar函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_active_sidebar函数的典型用法代码示例。如果您正苦于以下问题:PHP is_active_sidebar函数的具体用法?PHP is_active_sidebar怎么用?PHP is_active_sidebar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_active_sidebar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: penscratch_has_footer_widgets

 function penscratch_has_footer_widgets()
 {
     if (has_nav_menu('social') || jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
开发者ID:hlgrogan,项目名称:Sphinx-Site,代码行数:7,代码来源:jetpack.php


示例2: twentyeleven_footer_sidebar_class

/**
 * Count the number of footer sidebars to enable dynamic classes for the footer
 */
function twentyeleven_footer_sidebar_class()
{
    $count = 0;
    if (is_active_sidebar('sidebar-3')) {
        $count++;
    }
    if (is_active_sidebar('sidebar-4')) {
        $count++;
    }
    if (is_active_sidebar('sidebar-5')) {
        $count++;
    }
    $class = '';
    switch ($count) {
        case '1':
            $class = 'one';
            break;
        case '2':
            $class = 'two';
            break;
        case '3':
            $class = 'three';
            break;
    }
    if ($class) {
        echo 'class="' . $class . '"';
    }
}
开发者ID:keplerf,项目名称:Partybuses.ca,代码行数:31,代码来源:functions.php


示例3: siteorigin_north_body_classes

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function siteorigin_north_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    $classes[] = 'no-js';
    $classes[] = 'css3-animations';
    $classes[] = 'responsive';
    if (is_page()) {
        $classes[] = 'page-layout-' . SiteOrigin_Settings_Page_Settings::get('layout');
        $classes[] = 'page-layout-menu-' . SiteOrigin_Settings_Page_Settings::get('menu');
        if (!SiteOrigin_Settings_Page_Settings::get('masthead_margin')) {
            $classes[] = 'page-layout-no-masthead-margin';
        }
        if (!SiteOrigin_Settings_Page_Settings::get('footer_margin')) {
            $classes[] = 'page-layout-no-footer-margin';
        }
    }
    if (!is_active_sidebar('main-sidebar')) {
        $classes[] = 'no-active-sidebar';
    }
    if (siteorigin_setting('navigation_sticky')) {
        $classes[] = 'sticky-menu';
    }
    if (wp_is_mobile()) {
        $classes[] = 'is_mobile';
    }
    return $classes;
}
开发者ID:Gonzalez74,项目名称:siteorigin-north,代码行数:36,代码来源:extras.php


示例4: parallax_home_genesis_meta

/**
 * Add widget support for homepage. If no widgets active, display the default loop.
 *
 */
function parallax_home_genesis_meta()
{
    if (is_active_sidebar('home-section-1') || is_active_sidebar('home-section-2') || is_active_sidebar('home-section-3') || is_active_sidebar('home-section-4') || is_active_sidebar('home-section-5')) {
        //* Enqueue parallax script
        add_action('wp_enqueue_scripts', 'parallax_enqueue_parallax_script');
        function parallax_enqueue_parallax_script()
        {
            if (!wp_is_mobile()) {
                wp_enqueue_script('parallax-script', get_bloginfo('stylesheet_directory') . '/js/parallax.js', array('jquery'), '1.0.0');
            }
        }
        //* Add parallax-home body class
        add_filter('body_class', 'parallax_body_class');
        function parallax_body_class($classes)
        {
            $classes[] = 'parallax-home';
            return $classes;
        }
        //* Force full width content layout
        add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
        //* Remove primary navigation
        remove_action('genesis_before_content_sidebar_wrap', 'genesis_do_nav');
        //* Remove breadcrumbs
        remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
        //* Remove the default Genesis loop
        remove_action('genesis_loop', 'genesis_do_loop');
        //* Add homepage widgets
        add_action('genesis_loop', 'parallax_homepage_widgets');
    }
}
开发者ID:dbs4405,项目名称:cloudbase,代码行数:34,代码来源:front-page.php


示例5: ultra_body_classes

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function ultra_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    // Adds a class of content-none if there are no posts.
    if (!have_posts()) {
        $classes[] = 'content-none';
    }
    // Add widget-dependent classes.
    if (!is_active_sidebar('sidebar-1')) {
        $classes[] = 'one-column';
    }
    // Add a class if the sidebar is use.
    if (is_active_sidebar('sidebar-1')) {
        $classes[] = 'sidebar';
    }
    // Add a class if viewed on mobile.
    if (wp_is_mobile()) {
        $classes[] = 'mobile-device';
    }
    if (siteorigin_setting('header_tagline')) {
        $classes[] = 'tagline';
    }
    // Add a class if the page slider overlap is true.
    if (get_post_meta(get_the_ID(), 'ultra_metaslider_slider_overlap', true) == true) {
        $classes[] = 'overlap';
    }
    return $classes;
}
开发者ID:Zedash,项目名称:Ultra0.9.4,代码行数:37,代码来源:extras.php


示例6: get_bootplate_widget_footer_cols

 function get_bootplate_widget_footer_cols()
 {
     $got1 = is_active_sidebar('footer-1');
     $got2 = is_active_sidebar('footer-2');
     $got3 = is_active_sidebar('footer-3');
     $got4 = is_active_sidebar('footer-4');
     if ($got1 || $got2 || $got3 || $got4) {
         $gotsome = true;
     } else {
         $gotsome = false;
     }
     if ($got1 && $got2 && $got3 && $got4) {
         $gotall = true;
     } else {
         $gotall = false;
     }
     if ($gotall) {
         $classes = 'col-sm-6 col-lg-3';
     } elseif ($got1 && $got2 && !$got3 && !$got4 || !$got1 && !$got2 && $got3 && $got4) {
         $classes = 'col-sm-6';
     } elseif ($got1 && $got2 && $got3 && !$got4) {
         $classes = 'col-sm-4';
     } elseif ($got1 && $got2 && $got3 && $got4) {
         $classes = 'col-sm-6 col-lg-3';
     } else {
         $classes = 'col-md-12';
     }
     if ($gotsome) {
         return $classes;
     } else {
         return '';
     }
 }
开发者ID:jdmdigital,项目名称:bootplate,代码行数:33,代码来源:template-tags.php


示例7: genesis_footer_widget_areas

/**
 * Echo the markup necessary to facilitate the footer widget areas.
 *
 * Check for a numerical parameter given when adding theme support - if none is found, then the function returns early.
 *
 * The child theme must style the widget areas.
 *
 * Applies the `genesis_footer_widget_areas` filter.
 *
 * @since 1.6.0
 *
 * @uses genesis_structural_wrap() Optionally adds wrap with footer-widgets context.
 *
 * @return null Return early if number of widget areas could not be determined, or nothing is added to the first widget area.
 */
function genesis_footer_widget_areas()
{
    $footer_widgets = get_theme_support('genesis-footer-widgets');
    if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
        return;
    }
    $footer_widgets = (int) $footer_widgets[0];
    //* Check to see if first widget area has widgets. If not, do nothing. No need to check all footer widget areas.
    if (!is_active_sidebar('footer-1')) {
        return;
    }
    $inside = '';
    $output = '';
    $counter = 1;
    while ($counter <= $footer_widgets) {
        //* Darn you, WordPress! Gotta output buffer.
        ob_start();
        dynamic_sidebar('footer-' . $counter);
        $widgets = ob_get_clean();
        if ($widgets) {
            $inside .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
        }
        $counter++;
    }
    if ($inside) {
        $output .= genesis_markup(array('html5' => '<div %s>' . genesis_sidebar_title('Footer'), 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets', 'echo' => false));
        $output .= genesis_structural_wrap('footer-widgets', 'open', 0);
        $output .= $inside;
        $output .= genesis_structural_wrap('footer-widgets', 'close', 0);
        $output .= '</div>';
    }
    echo apply_filters('genesis_footer_widget_areas', $output, $footer_widgets);
}
开发者ID:robalford,项目名称:alfordhomesinc,代码行数:48,代码来源:footer.php


示例8: emphasize_bottomgroup

function emphasize_bottomgroup()
{
    $count = 0;
    if (is_active_sidebar('bottom1')) {
        $count++;
    }
    if (is_active_sidebar('bottom2')) {
        $count++;
    }
    if (is_active_sidebar('bottom3')) {
        $count++;
    }
    if (is_active_sidebar('bottom4')) {
        $count++;
    }
    $class = '';
    switch ($count) {
        case '1':
            $class = 'col-md-12';
            break;
        case '2':
            $class = 'col-md-6';
            break;
        case '3':
            $class = 'col-md-4';
            break;
        case '4':
            $class = 'col-md-3';
            break;
    }
    if ($class) {
        echo 'class="' . $class . '"';
    }
}
开发者ID:neetudave,项目名称:heartfulness-uk,代码行数:34,代码来源:sidebars.php


示例9: custom_body_classes

function custom_body_classes($classes)
{
    if (is_active_sidebar('sidebar-3')) {
        $classes[] = 'footer-widgets';
    }
    return $classes;
}
开发者ID:jballe,项目名称:Kragefolket.Website,代码行数:7,代码来源:functions.php


示例10: __construct

    public function __construct()
    {
        if (!is_admin()) {
            return;
        }
        $menus = get_theme_mod('nav_menu_locations');
        $this->theme = wp_get_theme();
        $has_listings = new WP_Query(array('post_type' => 'job_listing', 'fields' => 'ids', 'posts_per_page' => 1));
        $this->steps = array('install-plugins' => array('title' => __('Install Required &amp; Recommended Plugins', 'listify'), 'completed' => class_exists('WP_Job_Manager') && class_exists('WooCommerce'), 'description' => '<p>
						Before you can use Listify you must first install WP Job Manager and WooCommerce. 
						You can read about <a
						href="http://listify.astoundify.com/article/260-why-does-this-theme-require-plugins">why this theme
						requires plugins</a> in our documentation. 
					</p> 
					<p><strong>Note:</strong></strong>
					<ul>
						<li>When installing WP Job Manager and WooCommerce <strong>do not</strong> use the automatic setup and
						install the recommend pages. This will be done automatically when you import the demo XML.</li>
						<li>Only free plugins/add-ons can be installed automatically. You will need to install any premium
						plugins/add-ons separately.</li>
						<li>It is recommended you install and activate any additional plugins you plan on using before importing
						any XML content.</li>
						<li><strong>Once your plugins are installed</strong> and content is imported please review all plugin
						settings pages to make sure everything has been properly set up.</li>
					</ul>' . sprintf('<a href="%1$s/images/setup/setup-plugins.gif"><img
					src="%1$s/images/setup/setup-plugins.gif" width="430" alt=""
					/></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('themes.php?page=tgmpa-install-plugins'), __('Install Plugins', 'listify')) . '</p>', 'documentation' => array('WP Job Manager' => 'http://listify.astoundify.com/article/228-wp-job-manager', 'WooCommerce' => 'http://listify.astoundify.com/article/229-woocommerce', 'Jetpack' => 'http://listify.astoundify.com/article/230-jetpack', 'Bulk Install' => 'http://listify.astoundify.com/article/320-bulk-install-required-and-recommended-plugins')), 'import-content' => array('title' => __('Import Demo Content', 'listify'), 'completed' => $has_listings->have_posts(), 'description' => '<p>' . __('Installing the demo content is not required to use this theme. It is simply meant to provide a way to get a feel for the theme without having to manually set up all of your own content. <strong>If you choose not to import the demo content you need to make sure you manually create all necessary page templates for your website.</strong>', 'listify') . '</p>' . '<p>' . __('The Listify theme package includes multiple demo content .XML files. This is what you will
					upload to the WordPress importer. Depending on the plugins you have activated or the intended use of your
					website you may not need to upload all .XML files.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-content.gif"><img src="%1$s/images/setup/setup-content.gif" width="430" alt=""

					/></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('import.php'), __('Begin Importing Content', 'listify')) . '</p>', 'documentation' => array('Install Demo Content' => 'http://listify.astoundify.com/article/236-installing-demo-content', 'Manually Add a Listing' => 'http://listify.astoundify.com/article/245-adding-a-listing', 'Importing Content (Codex)' => 'http://codex.wordpress.org/Importing_Content', 'WordPress Importer' => 'https://wordpress.org/plugins/wordpress-importer/')), 'import-widgets' => array('title' => __('Import Widgets', 'listify'), 'completed' => is_active_sidebar('widget-area-home'), 'description' => '<p>' . __('Importing the demo widgets is not required to use this theme. It simply allows you to quickly match the same settings found on our theme demo. If you do not import the widgets you can manually manage your widgets just like a standard WordPress widget area.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-widgets.gif"><img src="%1$s/images/setup/setup-widgets.gif" width="430" alt="" /></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('tools.php?page=widget-importer-exporter'), __('Begin Importing Widgets', 'listify')) . '</p>', 'documentation' => array('Widget Areas' => 'http://listify.astoundify.com/category/352-widget-areas', 'Widgets' => 'http://listify.astoundify.com/category/199-widgets')), 'setup-menus' => array('title' => __('Setup Menus', 'listify'), 'description' => '<p>' . __('Make sure you create and assign your menus to the menu locations found in the theme. This is required to use the custom mega menu dropdown, account item, and more.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-menus.gif"><img src="%1$s/images/setup/setup-menus.gif" width="430" alt="" /></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('nav-menus.php'), __('Manage Menus', 'listify')) . '</p>', 'completed' => isset($menus['primary']), 'documentation' => array('Primary Menu' => 'http://listify.astoundify.com/article/250-manage-the-primary-menu', 'Secondary Menu' => 'http://listify.astoundify.com/article/253-manage-the-secondary-menu', 'Tertiary Menu' => 'http://listify.astoundify.com/article/254-enable-the-tertiary-navigation', 'Add a Dropdown' => 'http://listify.astoundify.com/article/252-add-a-dropdown-menu', 'Add an Avatar' => 'http://listify.astoundify.com/article/251-add-the-avatar-menu-item', 'Adding Icons' => 'http://listify.astoundify.com/article/257-adding-icons-to-menu-items', 'Create a Popup' => 'http://listify.astoundify.com/article/255-creating-a-popup-menu-item', 'Show/Hide Items' => 'http://listify.astoundify.com/article/256-show-different-menus-for-logged-in-or-logged-out')), 'setup-homepage' => array('title' => __('Setup Static Homepage', 'listify'), 'description' => '<p>' . __('In order to display custom widgets on your homepage you must first assign your static page in the WordPress settings. You can also set which page will display your blog posts.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-reading.gif"><img src="%1$s/images/setup/setup-reading.gif" width="430" alt="" /></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('options-reading.php'), __('Reading Settings', 'listify')) . '</p>', 'completed' => get_option('page_on_front'), 'documentation' => array('Create Your Homepage' => 'http://listify.astoundify.com/article/261-creating-your-homepage', 'Reading Settings (codex)' => 'http://codex.wordpress.org/Settings_Reading_Screen')), 'setup-widgets' => array('title' => __('Setup Widgets', 'listify'), 'completed' => is_active_sidebar('widget-area-home'), 'description' => '<p>' . __('Manage your widgets to control what displays on your homepage, listing pages, standard pages, and more.', 'listify') . '</p>' . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('widgets.php'), __('Manage Widgets', 'listify')) . '</p>', 'documentation' => array('Widget Areas' => 'http://listify.astoundify.com/category/352-widget-areas', 'Widgets' => 'http://listify.astoundify.com/category/199-widgets')), 'customize-theme' => array('title' => __('Customize', 'listify'), 'description' => '<p>' . __('Manage the appearance and behavior of various theme components with the live customizer.', 'listify') . '</p>' . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('customize.php'), __('Customize', 'listify')) . '</p>', 'completed' => get_option('theme_mods_listify'), 'documentation' => array('Appearance' => 'http://listify.astoundify.com/category/334-appearance', 'Booking Services' => 'http://listify.astoundify.com/category/455-booking-service-integration', 'Child Themes' => 'http://listify.astoundify.com/category/209-child-themes', 'Translations' => 'http://listify.astoundify.com/category/210-translations')), 'support-us' => array('title' => __('Get Involved', 'listify'), 'description' => __('Help improve Listify by submitting a rating and helping to translate the theme to as many languages as possible!', 'listify'), 'completed' => true, 'documentation' => array('Leave a Positive Review' => 'http://bit.ly/rate-listify', 'Contribute Your Translation' => 'http://bit.ly/translate-listify')));
        add_action('admin_menu', array($this, 'add_page'), 100);
        add_action('admin_menu', array($this, 'add_meta_boxes'));
        add_action('admin_head', array($this, 'admin_css'));
    }
开发者ID:GaryJones,项目名称:dockerfiles,代码行数:35,代码来源:class-setup.php


示例11: magazine_home_loop_helper

/**
 * Add widget support for homepage. If no widgets active, display the default loop.
 *
 */
function magazine_home_loop_helper()
{
    if (is_active_sidebar('home-top') || is_active_sidebar('home-left') || is_active_sidebar('home-right') || is_active_sidebar('home-bottom')) {
        if (is_active_sidebar('home-top')) {
            echo '<div class="home-top">';
            dynamic_sidebar('home-top');
            echo '</div><!-- end .home-top -->';
        }
        if (is_active_sidebar('home-left') || is_active_sidebar('home-right')) {
            echo '<div class="home-middle">';
            if (is_active_sidebar('home-left')) {
                echo '<div class="home-left">';
                dynamic_sidebar('home-left');
                echo '</div><!-- end .home-left -->';
            }
            if (is_active_sidebar('home-right')) {
                echo '<div class="home-right">';
                dynamic_sidebar('home-right');
                echo '</div><!-- end .home-right -->';
            }
            echo '</div><!-- end .home-middle -->';
        }
        if (is_active_sidebar('home-bottom')) {
            echo '<div class="home-bottom">';
            dynamic_sidebar('home-bottom');
            echo '</div><!-- end .home-bottom -->';
        }
    } else {
        genesis_standard_loop();
    }
}
开发者ID:nmrugg,项目名称:studiopress-premum-wp-themes,代码行数:35,代码来源:home.php


示例12: _lbbee78bef56_content

    function _lbbee78bef56_content($_l, $_args)
    {
        extract($_args);
        ?>

<section class="section content-section blog-section not-found-section">

	<div id="container" class="subpage blog 404 wrapper <?php 
        if (is_active_sidebar("blog-sidebar")) {
        } else {
            ?>
onecolumn<?php 
        }
        ?>
">

		<div id="content" class="entry-content clearfix" role="main">
			<div class="content-wrapper">
<?php 
        NCoreMacros::includeTemplate("snippets/nothing-found.php", $template->getParams(), $_l->templates['pemu234rbc'])->render();
        ?>
			</div> <!-- /.content-wrapper -->
		</div> <!-- /#content -->

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

</section>

<?php 
    }
开发者ID:ssuhss,项目名称:Begara,代码行数:30,代码来源:_Templates.404.php-afc161dc94512f8d58ada44440871ec5.php


示例13: dln_template_blank_page

function dln_template_blank_page()
{
    if (is_page_template('page-templates/blank-page.php') || is_attachment() || !is_active_sidebar('sidebar-1')) {
        global $content_width;
        $content_width = 960;
    }
}
开发者ID:httvncoder,项目名称:151722441,代码行数:7,代码来源:functions.php


示例14: jumbotron_content

 function jumbotron_content()
 {
     global $ss_settings, $ss_framework;
     $hero = false;
     $site_style = $ss_settings['site_style'];
     $visibility = $ss_settings['jumbotron_visibility'];
     $nocontainer = $ss_settings['jumbotron_nocontainer'];
     if (($visibility == 1 && is_front_page() || $visibility != 1) && is_active_sidebar('jumbotron')) {
         $hero = true;
     }
     if ($hero) {
         echo $ss_framework->clearfix();
         echo '<div class="before-main-wrapper">';
         if ($site_style == 'boxed' && $nocontainer != 1) {
             echo '<div class="' . Shoestrap_Layout::container_class() . '">';
         }
         echo '<div class="jumbotron">';
         if ($nocontainer != 1 && $site_style == 'wide' || $site_style == 'boxed') {
             echo '<div class="' . Shoestrap_Layout::container_class() . '">';
         }
         dynamic_sidebar('Jumbotron');
         if ($nocontainer != 1 && $site_style == 'wide' || $site_style == 'boxed') {
             echo '</div>';
         }
         echo '</div>';
         if ($site_style == 'boxed' && $nocontainer != 1) {
             echo '</div>';
         }
         echo '</div>';
     }
 }
开发者ID:MinecraftServernet,项目名称:shoestrap-3,代码行数:31,代码来源:class-Shoestrap_Jumbotron.php


示例15: oriental_infinite_scroll_has_footer_widgets

 function oriental_infinite_scroll_has_footer_widgets()
 {
     if (function_exists('jetpack_is_mobile') && jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
开发者ID:AtomPy,项目名称:AtomPySite,代码行数:7,代码来源:functions.php


示例16: landscape_has_footer_widgets

 function landscape_has_footer_widgets()
 {
     if (jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
开发者ID:pradeep-web,项目名称:brandt,代码行数:7,代码来源:jetpack.php


示例17: twenty_ten_has_footer_widgets

/**
 * Do we have footer widgets?
 */
function twenty_ten_has_footer_widgets($has_widgets)
{
    if (is_active_sidebar('first-footer-widget-area') || is_active_sidebar('second-footer-widget-area') || is_active_sidebar('third-footer-widget-area') || is_active_sidebar('fourth-footer-widget-area')) {
        $has_widgets = true;
    }
    return $has_widgets;
}
开发者ID:kanei,项目名称:vantuch.cz,代码行数:10,代码来源:twentyten.php


示例18: sela_content_width

/**
 * Adjusts content_width value for few pages and attachment templates.
 */
function sela_content_width()
{
    global $content_width;
    if (is_page_template('page-templates/full-width-page.php') || is_page_template('page-templates/grid-page.php') || is_attachment() || !is_active_sidebar('sidebar-1')) {
        $content_width = 778;
    }
}
开发者ID:francisco-vx,项目名称:wordpress,代码行数:10,代码来源:functions.php


示例19: render_widget_area

 /**
  * Widget area render function.
  *
  * @since  1.0.0
  * @param  string $area_id Widget area id.
  * @return void
  */
 public function render_widget_area($area_id)
 {
     if (!is_active_sidebar($area_id)) {
         return;
     }
     // Conditional page tags checking
     if (isset($this->widgets_settings[$area_id]['conditional']) && !empty($this->widgets_settings[$area_id]['conditional'])) {
         foreach ($this->widgets_settings[$area_id]['conditional'] as $conditional) {
             if (!call_user_func($conditional)) {
                 return;
             }
         }
     }
     $area_id = apply_filters('king_news_rendering_current_widget_area', $area_id);
     $before_wrapper = isset($this->widgets_settings[$area_id]['before_wrapper']) ? $this->widgets_settings[$area_id]['before_wrapper'] : '<div id="%1$s" %2$s>';
     $after_wrapper = isset($this->widgets_settings[$area_id]['after_wrapper']) ? $this->widgets_settings[$area_id]['after_wrapper'] : '</div>';
     $classes = array($area_id, 'widget-area');
     $classes = apply_filters('king_news_widget_area_classes', $classes, $area_id);
     if (is_array($classes)) {
         $classes = 'class="' . join(' ', $classes) . '"';
     }
     printf($before_wrapper, $area_id, $classes);
     dynamic_sidebar($area_id);
     printf($after_wrapper);
 }
开发者ID:vfedushchin,项目名称:KingNews,代码行数:32,代码来源:class-tm-widget-area.php


示例20: wp_cta_replace_sidebars

function wp_cta_replace_sidebars()
{
    global $_wp_sidebars_widgets, $post, $wp_registered_sidebars, $wp_registered_widgets;
    if (isset($post) && $post->post_type == 'wp-call-to-action') {
        $original_widgets = $_wp_sidebars_widgets;
        //print_r($original_widgets);exit;
        //print_r($wp_registered_sidebars);exit;
        //print_r($wp_registered_widgets);exit;
        //print_r($_wp_sidebars_widgets['wp_cta_sidebar']);exit;
        if (!is_active_sidebar('wp_cta_sidebar')) {
            $active_widgets = get_option('sidebars_widgets');
            $active_widgets['wp_cta_sidebar'] = array('0', 'id_wp_cta_conversion_area_widget-1');
            update_option('sidebars_widgets', $active_widgets);
        }
        $stop = 0;
        foreach ($original_widgets as $key => $val) {
            //$disable = apply_filters('wp_cta_disable_sidebar_removal', false);
            if (stristr($key, 'header') || stristr($key, 'footer') || stristr($key, 'wp_cta_sidebar') || stristr($key, 'wp_inactive_widgets') || stristr($key, 'wp_inactive_widgets') || stristr($key, 'array_version')) {
            } else {
                if (strstr($key, 'secondary')) {
                    unset($_wp_sidebars_widgets[$key]);
                } else {
                    //unset($_wp_sidebars_widgets[$key]);
                    $_wp_sidebars_widgets[$key] = $_wp_sidebars_widgets['wp_cta_sidebar'];
                    $stop = 1;
                }
            }
        }
        //print_r($_wp_sidebars_widgets);exit;
    }
}
开发者ID:hkarriche,项目名称:wordpress,代码行数:31,代码来源:module.sidebar.php



注:本文中的is_active_sidebar函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_active_widget函数代码示例发布时间:2022-05-15
下一篇:
PHP is_active函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap