Breadcrumbs in wordpress

global $post; // if outside the loop

if (is_page() && $post->post_parent) {
    $parent_title = get_the_title($post->post_parent);

    echo ' » ' . $parent_title . ' » ';
    wp_title('');

} else if (is_page()) {
    echo ' » ';
    wp_title('');

} else {

}

Comments

Popular posts from this blog

HTML5 video loop src change on end play function

Set limit wp_nav_menu

Calculate percentage of a specific element has been scrolled into visible on the screen