コード例 #1
0
ファイル: template.php プロジェクト: venturepact/blog
function xt_smart_sidebar()
{
    global $post;
    $post_settings = xt_get_single_settings('post');
    extract($post_settings);
    $is_endless_template = xt_is_endless_template();
    $enabled = (bool) xt_option('single_post_smart_sidebar');
    if (!$enabled || $is_endless_template) {
        return false;
    }
    $position = xt_option('single_post_smart_sidebar_position');
    $items = xt_option('single_post_smart_sidebar_items');
    if (empty($items["enabled"])) {
        return false;
    }
    echo '<div class="smart-sidebar">';
    foreach ($items["enabled"] as $key => $item) {
        echo '<div class="smart-sidebar-item">';
        if (strpos($key, 'divider') !== false) {
            echo '<div class="smart-sidebar-divider"></div>';
        } else {
            if ($key == 'social-share') {
                echo xt_socialshare();
            } else {
                if ($key == 'post-date' && $show_post_date) {
                    xt_post_date();
                } else {
                    if ($key == 'post-author' && $show_post_author) {
                        xt_post_author();
                    } else {
                        if ($key == 'post-stats' && $show_post_stats) {
                            echo '<div class="meta">';
                            xt_post_stats(true, array('mini'));
                            echo '</div>';
                        } else {
                            if ($key == 'widget-zone' && $show_post_author) {
                                $widget_zone = xt_option('single_post_smart_sidebar_widget_zone');
                                $widget_zone_active = is_active_sidebar($widget_zone);
                                if ($widget_zone_active) {
                                    xt_show_dynamic_sidebar($widget_zone, 'single-post.php', "smart-sidebar", "smart-{$datemodified_enabled} position-" . $position);
                                }
                            }
                        }
                    }
                }
            }
        }
        echo '</div>';
    }
    echo '</div>';
}
コード例 #2
0
ファイル: post-full.php プロジェクト: venturepact/blog
<?php

global $post, $sidebar_below_title, $is_endless_template;
$post_format = get_post_format();
$is_endless_template = xt_is_endless_template();
$sidebar_below_title = xt_is_sidebar_below_title($post->ID);
//Featured image settings
list($single_post_featured_image, $single_post_featured_image_position) = xt_get_featured_image_settings($post->ID);
$behind_title_fw = $single_post_featured_image_position == 'behind-title-fullwidth';
if ($behind_title_fw && !$sidebar_below_title) {
    $sidebar_below_title = true;
}
// Post settings
$post_settings = xt_get_single_settings('post');
extract($post_settings);
// Smart Sidebar
$smart_sidebar_position = xt_smart_sidebar_position();
$smart_sidebar_enabled = $smart_sidebar_position !== false;
?>

			<!--Single Article -->	
				
			<article id="post-<?php 
the_ID();
?>
" data-postid="<?php 
echo esc_attr($post->ID);
?>
" data-guid="<?php 
echo esc_attr(get_the_guid($post->ID));
?>