コード例 #1
0
ファイル: sidebar.php プロジェクト: chenruixuan/V2Press
    }
    ?>
        </div>
        <div class="inner">
            <p class="center"><?php 
    vp_page_link(array('slug' => 'signup', 'text' => __('Signup', 'v2press'), 'class' => 'btn'));
    ?>
</p>
            <p class="fade center"><?php 
    printf(__('Already signup? %s', 'v2press'), vp_page_link(array('slug' => 'signin', 'text' => __('Signin', 'v2press'), 'display' => false)));
    ?>
</p>
        </div>
        <?php 
}
// END if is_user_logged_in()
?>
    </div>

    <?php 
if (is_home()) {
    vp_get_template_part('sidebar', 'home');
} elseif (is_single() && !vp_is_edit() || is_category()) {
    vp_get_template_part('sidebar', 'category');
} elseif (is_page('new') || vp_is_edit()) {
    vp_get_template_part('sidebar', 'new');
}
?>

</aside><!--END #sidebar-->
コード例 #2
0
ファイル: vp-general.php プロジェクト: chenruixuan/V2Press
/**
 * Simple breadcrumb navigation.
 *
 * Just display breadcrumb at page, single and category page.
 *
 * @since 0.0.1
 *
 * @param string $sep The seperator between two navigation items.
 * @return string Just the breadcrumb navigation links, no wrapper.
 */
function vp_breadcrumb($sep = ' &#155; ')
{
    $output = '<a href="' . home_url() . '">' . get_bloginfo('name') . '</a>' . $sep;
    if (is_page() && !is_page('new')) {
        $output .= get_the_title();
    } elseif (is_page('new')) {
        if (!empty($_GET['node'])) {
            $node_id = (int) $_GET['node'];
            $node = get_term_by('id', $node_id, 'category');
            if (!$node) {
                wp_redirect(home_url());
                exit;
            }
            $node_name = $node->name;
            $node_link = get_category_link($node);
            $output .= '<a href="' . $node_link . '">' . $node_name . '</a>' . $sep;
        }
        $output .= __('Create New Topic', 'v2press');
    } elseif (is_single() && !vp_is_edit()) {
        $output .= get_the_category_list(', ');
    } elseif (vp_is_edit()) {
        $output .= sprintf(__('Edit "%s"', 'v2press'), get_the_title());
    } elseif (is_category()) {
        $output .= single_cat_title('', false);
    } elseif (is_author()) {
        $curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
        $output .= $curauth->user_login;
    } elseif (is_search()) {
        $output .= sprintf(__('Search results for "%s"', 'v2press'), get_search_query());
    } else {
        if (is_404()) {
            $output .= __('Not Found', 'v2press');
        }
    }
    echo $output;
}