Exemple #1
0
    function vce_display_metabox($object, $box)
    {
        $vce_meta = vce_get_post_meta($object->ID);
        ?>
	   <p class="description"><?php 
        _e('Override display options for this particular post instead of using global options set in Theme Options -> Single Post', THEME_SLUG);
        ?>
</p>
	   <p><label><?php 
        _e('Category link', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_cat', $vce_meta['display']['show_cat']);
        ?>
</p>
	   <p><label><?php 
        _e('Featured image', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_fimg', $vce_meta['display']['show_fimg']);
        ?>
</p>
	   <p><label><?php 
        _e('Author image', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_author_img', $vce_meta['display']['show_author_img']);
        ?>
</p>
	   <p><label><?php 
        _e('Headline (excerpt)', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_headline', $vce_meta['display']['show_headline']);
        ?>
</p>
	   <p><label><?php 
        _e('Tags', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_tags', $vce_meta['display']['show_tags']);
        ?>
</p>
	   <p><label><?php 
        _e('Prev/next posts', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_prev_next', $vce_meta['display']['show_prev_next']);
        ?>
</p>
	   <p><label><?php 
        _e('Related posts', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_related', $vce_meta['display']['show_related']);
        ?>
</p>
	   <p><label><?php 
        _e('Author box', THEME_SLUG);
        ?>
:</label> <?php 
        vce_post_display_option('show_author_box', $vce_meta['display']['show_author_box']);
        ?>
</p>
	  <?php 
    }
Exemple #2
0
 function vce_get_current_sidebar()
 {
     /* Default */
     $use_sidebar = 'none';
     $sidebar = 'vce_default_sidebar';
     $sticky_sidebar = 'vce_default_sticky_sidebar';
     $vce_template = vce_detect_template();
     if (in_array($vce_template, array('search', 'tag', 'author', 'archive'))) {
         $use_sidebar = vce_get_option($vce_template . '_use_sidebar');
         if ($use_sidebar != 'none') {
             $sidebar = vce_get_option($vce_template . '_sidebar');
             $sticky_sidebar = vce_get_option($vce_template . '_sticky_sidebar');
         }
     } else {
         if ($vce_template == 'category') {
             $obj = get_queried_object();
             if (isset($obj->term_id)) {
                 $meta = vce_get_category_meta($obj->term_id);
             }
             if ($meta['use_sidebar'] != 'none') {
                 $use_sidebar = $meta['use_sidebar'] == 'inherit' ? vce_get_option($vce_template . '_use_sidebar') : $meta['use_sidebar'];
                 if ($use_sidebar) {
                     $sidebar = $meta['sidebar'] == 'inherit' ? vce_get_option($vce_template . '_sidebar') : $meta['sidebar'];
                     $sticky_sidebar = $meta['sticky_sidebar'] == 'inherit' ? vce_get_option($vce_template . '_sticky_sidebar') : $meta['sticky_sidebar'];
                 }
             }
         } else {
             if ($vce_template == 'single') {
                 $meta = vce_get_post_meta(get_the_ID());
                 $use_sidebar = $meta['use_sidebar'] == 'inherit' ? vce_get_option($vce_template . '_use_sidebar') : $meta['use_sidebar'];
                 if ($use_sidebar != 'none') {
                     $sidebar = $meta['sidebar'] == 'inherit' ? vce_get_option($vce_template . '_sidebar') : $meta['sidebar'];
                     $sticky_sidebar = $meta['sticky_sidebar'] == 'inherit' ? vce_get_option($vce_template . '_sticky_sidebar') : $meta['sticky_sidebar'];
                 }
             } else {
                 if (in_array($vce_template, array('home_page', 'page', 'posts_page'))) {
                     if ($vce_template == 'posts_page') {
                         $meta = vce_get_page_meta(get_option('page_for_posts'));
                     } else {
                         $meta = vce_get_page_meta(get_the_ID());
                     }
                     $use_sidebar = $meta['use_sidebar'] == 'inherit' ? vce_get_option('page_use_sidebar') : $meta['use_sidebar'];
                     if ($use_sidebar != 'none') {
                         $sidebar = $meta['sidebar'] == 'inherit' ? vce_get_option('page_sidebar') : $meta['sidebar'];
                         $sticky_sidebar = $meta['sticky_sidebar'] == 'inherit' ? vce_get_option('page_sticky_sidebar') : $meta['sticky_sidebar'];
                     }
                 }
             }
         }
     }
     $args = array('use_sidebar' => $use_sidebar, 'sidebar' => $sidebar, 'sticky_sidebar' => $sticky_sidebar);
     return $args;
 }