예제 #1
0
function xt_get_template_settings($type = 'post')
{
    global $post;
    $page_id = xt_get_page_ID();
    $template_settings = array();
    switch ($type) {
        case 'post':
            $template_settings["query_post_formats"] = get_field('query_post_formats', $page_id) ? '1' : '';
            $template_settings["format"] = get_field('format', $page_id);
            $template_settings["show_post_category"] = get_field('show_post_category', $page_id);
            $template_settings["show_post_excerpt"] = get_field('show_post_excerpt', $page_id);
            $template_settings["show_post_date"] = get_field('show_post_date', $page_id);
            $template_settings["show_post_author"] = get_field('show_post_author', $page_id);
            $template_settings["show_post_stats"] = get_field('show_post_stats', $page_id);
            break;
    }
    $template_settings = array_filter($template_settings, 'xt_template_settings_filter');
    return $template_settings;
}
예제 #2
0
파일: page.php 프로젝트: venturepact/blog
<?php

/**
 * Setup Dynamic Sidebar
 */
$page_id = xt_get_page_ID();
list($has_sidebar, $sidebar_position, $sidebar_area) = xt_setup_dynamic_sidebar($page_id);
$hide_page_title = (bool) get_field('hide_page_title', $page_id);
$page_container_no_padding = (bool) get_field('page_container_no_padding', $page_id);
$has_composer = xt_page_has_composer();
$special_page = xt_page_is_special();
$full_width_page = $has_composer;
$current_page_title = get_the_title();
get_header();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
	

<div class="row<?php 
        echo !empty($full_width_page) ? ' full-width' : '';
        echo $has_sidebar ? ' has-sidebar' : '';
        ?>
">
 
	<div class="medium-<?php 
        echo $has_sidebar ? '8' : '12';
        ?>
  column<?php 
        echo $sidebar_position === 'left' ? ' right' : '';
예제 #3
0
 function enqueue_dynamic_styles()
 {
     global $wp_query, $post;
     $post_id = xt_get_page_ID();
     if ($post_id !== false) {
         include_once XT_ASSETS_DIR . '/dynamic.php';
         if (!empty($xt_custom_css)) {
             wp_add_inline_style('xt-style', $xt_custom_css);
         }
     }
 }