本文整理匯總了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>