NAzT
9/12/2013 - 8:17 AM

public_html/wp-content/themes/charitas-wpl/inc/library.php

public_html/wp-content/themes/charitas-wpl/inc/library.php

/*-----------------------------------------------------------
        Breadcrumbs
-----------------------------------------------------------*/

function wplook_breadcrumbs() {

        $showOnHome     = '0'; // 1 - show breadcrumbs on the homepage, 0 - don't show
        $delimiter      = '>'; // delimiter between crumbs
        $hometext       = 'Home Page'; // text for the 'Home' link
        $showCurrent    = '1'; // 1 - show current post/page title in breadcrumbs, 0 - don't show
        $before                 = '<span class="current">'; // tag before the current crumb
        $after          = '</span>'; // tag after the current crumb

        global $post;
        $homeLink = home_url( '/' );

        echo '<a href="' . $homeLink . '">' . $hometext . '</a> ' . $delimiter . ' ';

        if ( is_category() ) {
                global $wp_query, $author;

                $user_info = get_userdata($author);
                $cat_obj = $wp_query->get_queried_object();
                $thisCat = $cat_obj->term_id;
                $thisCat = get_category($thisCat);
                $parentCat = get_category($thisCat->parent);
                if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
                echo $before . single_cat_title(' ', false) . ": ". $user_info->display_name. $after;
        } elseif ( is_search() ) {
                echo $before . 'Search results for "' . get_search_query() . '"' . $after;

        } elseif ( is_day() ) {
                echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
                echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
                echo $before . get_the_time('d') . $after;

        } elseif ( is_month() ) {
                echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
                echo $before . get_the_time('F') . $after;

        } elseif ( is_year() ) {
                echo $before . get_the_time('Y') . $after;

        } elseif ( is_single() && !is_attachment() ) {
                if ( get_post_type() != 'post' ) {
                        $post_type = get_post_type_object(get_post_type());
                        $slug = $post_type->rewrite;
                        $str = '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->all_items . '</a>';