本文整理汇总了PHP中sf_set_sidebar_global函数的典型用法代码示例。如果您正苦于以下问题:PHP sf_set_sidebar_global函数的具体用法?PHP sf_set_sidebar_global怎么用?PHP sf_set_sidebar_global使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sf_set_sidebar_global函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sf_base_sidebar
function sf_base_sidebar($type)
{
// VARIABLES
global $post, $sf_options;
// DEFAULT SIDEBAR CONFIG
$default_sidebar_config = $sf_options['default_sidebar_config'];
$default_left_sidebar = $sf_options['default_left_sidebar'];
$default_right_sidebar = $sf_options['default_right_sidebar'];
$buddypress = sf_is_buddypress();
$bbpress = sf_is_bbpress();
$sidebar_config = $left_sidebar = $right_sidebar = $sidebar_progress_menu = "";
// ARCHIVE / CATEGORY SIDEBAR CONFIG
if (is_search() || is_archive() || is_author() || is_category() || is_home()) {
$default_sidebar_config = $sf_options['archive_sidebar_config'];
$default_left_sidebar = $sf_options['archive_sidebar_left'];
$default_right_sidebar = $sf_options['archive_sidebar_right'];
}
// DIRECTORY ARCHIVE
if (is_post_type_archive('directory')) {
$sidebar_config = "no-sidebars";
}
// PORTFOLIO CATEGORY SIDEBAR CONFIG
if (is_tax('portfolio-category')) {
$sidebar_config = "no-sidebars";
}
if (is_tax('download_category')) {
$default_left_sidebar = 'crowdfunding-sidebar';
$default_right_sidebar = 'crowdfunding-sidebar';
}
// BUDDYPRESS SIDEBAR CONFIG
if ($buddypress != "") {
$default_sidebar_config = $sf_options['bp_sidebar_config'];
$default_left_sidebar = $sf_options['bp_sidebar_left'];
$default_right_sidebar = $sf_options['bp_sidebar_right'];
}
// BBPRESS SIDEBAR CONFIG
if ($bbpress) {
$default_sidebar_config = $sf_options['bb_sidebar_config'];
$default_left_sidebar = $sf_options['bb_sidebar_left'];
$default_right_sidebar = $sf_options['bb_sidebar_right'];
}
// CURRENT POST/PAGE SIDEBAR CONFIG
if ($post && is_singular()) {
$sidebar_config = sf_get_post_meta($post->ID, 'sf_sidebar_config', true);
$left_sidebar = sf_get_post_meta($post->ID, 'sf_left_sidebar', true);
$right_sidebar = sf_get_post_meta($post->ID, 'sf_right_sidebar', true);
$sidebar_progress_menu = sf_get_post_meta($post->ID, 'sf_sidebar_progress_menu', true);
}
if (is_404()) {
$sidebar_config = $sf_options['404_sidebar_config'];
$left_sidebar = $sf_options['404_left_sidebar'];
$right_sidebar = $sf_options['404_right_sidebar'];
}
// DEFAULTS
if ($sidebar_config == "") {
$sidebar_config = $default_sidebar_config;
}
if ($left_sidebar == "") {
$left_sidebar = $default_left_sidebar;
}
if ($right_sidebar == "") {
$right_sidebar = $default_right_sidebar;
}
// EVENTS
if ($type == "events-ls") {
$sidebar_config = "left-sidebar";
$left_sidebar = "events-sidebar-left";
}
if ($type == "events-rs") {
$sidebar_config = "right-sidebar";
$right_sidebar = "events-sidebar-right";
}
if ($type == "events-bs") {
$sidebar_config = "both-sidebars";
$left_sidebar = "events-sidebar-left";
$right_sidebar = "events-sidebar-right";
}
// Sidebar Progress Menu
if ($sidebar_progress_menu == "left-sidebar" && !($sidebar_config == "left-sidebar" || $sidebar_config == "both-sidebars")) {
$sidebar_config = "left-sidebar";
}
if ($sidebar_progress_menu == "right-sidebar" && !($sidebar_config == "right-sidebar" || $sidebar_config == "both-sidebars")) {
$sidebar_config = "right-sidebar";
}
if ($sidebar_progress_menu == "left-sidebar") {
$left_sidebar = "";
add_action('sf_before_left_sidebar', 'sf_side_progress_menu');
}
if ($sidebar_progress_menu == "right-sidebar") {
$right_sidebar = "";
add_action('sf_before_right_sidebar', 'sf_side_progress_menu');
}
// SET SIDEBAR GLOBAL
sf_set_sidebar_global($sidebar_config);
// PAGE WRAP CLASS
$page_wrap_class = '';
if ($sidebar_config == "left-sidebar") {
$page_wrap_class = 'has-left-sidebar has-one-sidebar row';
} else {
if ($sidebar_config == "right-sidebar") {
//.........这里部分代码省略.........
示例2: sf_get_post_meta
$fancy_title_image_url = $detail_image['url'];
break;
}
$sidebar_config = sf_get_post_meta($post->ID, 'sf_sidebar_config', true);
$left_sidebar = sf_get_post_meta($post->ID, 'sf_left_sidebar', true);
$right_sidebar = sf_get_post_meta($post->ID, 'sf_right_sidebar', true);
if ($sidebar_config == "") {
$sidebar_config = $default_sidebar_config;
}
if ($left_sidebar == "") {
$left_sidebar = $default_left_sidebar;
}
if ($right_sidebar == "") {
$right_sidebar = $default_right_sidebar;
}
sf_set_sidebar_global($sidebar_config);
$page_wrap_class = '';
if ($sidebar_config == "left-sidebar") {
$page_wrap_class = 'has-left-sidebar has-one-sidebar row';
} else {
if ($sidebar_config == "right-sidebar") {
$page_wrap_class = 'has-right-sidebar has-one-sidebar row';
} else {
if ($sidebar_config == "both-sidebars") {
$page_wrap_class = 'has-both-sidebars';
} else {
$page_wrap_class = 'has-no-sidebar';
}
}
}
global $sf_has_products, $sf_include_isotope;
示例3: sf_set_sidebar_global
<?php
sf_set_sidebar_global('no-sidebars');
?>
<?php
if (have_posts()) {
the_post();
?>
<!-- OPEN article -->
<article <?php
post_class('clearfix');
?>
id="<?php
the_ID();
?>
">
<section class="page-content clearfix container">
<div class="content-wrap <?php
echo esc_attr($content_wrap_class);
?>
clearfix">
<?php
echo atcf_shortcode_submit(array('editing' => is_preview() ? false : true, 'previewing' => is_preview() ? true : false));
?>
</div>
</section>