示例#1
0
function cpotheme_get_sidebar_position()
{
    $current_id = cpotheme_current_id();
    if (is_tax() || is_category() || is_tag()) {
        $sidebar_layout = cpotheme_tax_meta($current_id, 'layout_sidebar');
    } else {
        $sidebar_layout = get_post_meta($current_id, 'layout_sidebar', true);
    }
    if ($sidebar_layout == '') {
        $sidebar_layout = 'right';
    }
    return $sidebar_layout;
}
示例#2
0
 function cpotheme_secondary_menu($taxonomy = 'cpo_portfolio_category', $class)
 {
     if (taxonomy_exists($taxonomy)) {
         $feature_posts = get_terms($taxonomy, 'order=ASC&orderby=name');
         if (sizeof($feature_posts) > 0) {
             $current_id = cpotheme_current_id();
             echo '<div id="menu-secondary ' . $class . '" class="menu-secondary ' . $class . '">';
             foreach ($feature_posts as $current_item) {
                 $active_item = '';
                 if ($current_item->term_id == $current_id) {
                     $active_item = ' menu-item-active';
                 }
                 echo '<a href="' . get_term_link($current_item, 'cpo_portfolio_category') . '" class="menu-item' . $active_item . '">';
                 echo '<div class="menu-title">' . $current_item->name . '</div>';
                 echo '</a>';
             }
             echo '</div>';
         }
     }
 }