コード例 #1
0
function breadcrumbs($args = array())
{
    $delimiter = __('<span class="crumbs-span">/</span>', 'vbegy');
    $home = __('Home', 'vbegy');
    $before = '<h1>';
    $after = '</h1>';
    if (!is_home() && !is_front_page() || is_paged()) {
        echo '<div class="breadcrumbs"><section class="container"><div class="row"><div class="col-md-12">';
        global $post, $wp_query;
        $item = array();
        $homeLink = home_url();
        if (is_search()) {
            echo $before . __("Search", "vbegy") . $after;
        } else {
            if (is_page()) {
                echo $before . get_the_title() . $after;
            } else {
                if (is_attachment()) {
                    $parent = get_post($post->post_parent);
                    $cat = get_the_category($parent->ID);
                    echo $before . get_the_title() . $after;
                } elseif (is_singular()) {
                    $post = $wp_query->get_queried_object();
                    $post_id = (int) $wp_query->get_queried_object_id();
                    $post_type = $post->post_type;
                    $post_type_object = get_post_type_object($post_type);
                    if ('post' === $wp_query->post->post_type || 'question' === $wp_query->post->post_type || 'product' === $wp_query->post->post_type) {
                        echo $before . get_the_title() . $after;
                    }
                    if ('page' !== $wp_query->post->post_type) {
                        if (isset($args["singular_{$wp_query->post->post_type}_taxonomy"]) && is_taxonomy_hierarchical($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                            $terms = wp_get_object_terms($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"]);
                            echo array_merge($item, breadcrumbs_plus_get_term_parents($terms[0], $args["singular_{$wp_query->post->post_type}_taxonomy"]));
                        } elseif (isset($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                            echo get_the_term_list($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"], '', ', ', '');
                        }
                    }
                } else {
                    if (is_category() || is_tag() || is_tax()) {
                        global $wp_query;
                        $term = $wp_query->get_queried_object();
                        $taxonomy = get_taxonomy($term->taxonomy);
                        if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent && ($parents = breadcrumbs_plus_get_term_parents($term->parent, $term->taxonomy))) {
                            $item = array_merge($item, $parents);
                        }
                        //echo $term->name;
                        echo $before . '' . single_cat_title('', false) . '' . $after;
                    } elseif (is_day()) {
                        echo $before . __('Daily Archives : ', 'vbegy') . get_the_time('d') . $after;
                    } elseif (is_month()) {
                        echo $before . __('Monthly Archives : ', 'vbegy') . get_the_time('F') . $after;
                    } elseif (is_year()) {
                        echo $before . __('Yearly Archives : ', 'vbegy') . get_the_time('Y') . $after;
                    } elseif (is_single() && !is_attachment()) {
                        if (get_post_type() != 'post' && get_post_type() != 'question' && get_post_type() != 'product') {
                            $post_type = get_post_type_object(get_post_type());
                            $slug = $post_type->rewrite;
                            echo $before . get_the_title() . $after;
                        } else {
                            $cat = get_the_category();
                            $cat = $cat[0];
                            echo $before . get_the_title() . $after;
                        }
                    } elseif (!is_single() && !is_page() && get_post_type() != 'post' && get_post_type() != 'question' && get_post_type() != 'product') {
                        if (is_author()) {
                            global $author;
                            $userdata = get_userdata($author);
                            echo $before . $userdata->display_name . $after;
                        } else {
                            $post_type = get_post_type_object(get_post_type());
                            echo $before . (isset($post_type->labels->singular_name) ? $post_type->labels->singular_name : __("Error 404", "vbegy")) . $after;
                        }
                    } elseif (is_attachment()) {
                        $parent = get_post($post->post_parent);
                        $cat = get_the_category($parent->ID);
                        echo $before . get_the_title() . $after;
                    } elseif (is_page() && !$post->post_parent) {
                        echo $before . get_the_title() . $after;
                    } elseif (is_page() && $post->post_parent) {
                        $parent_id = $post->post_parent;
                        $breadcrumbs = array();
                        while ($parent_id) {
                            $page = get_page($parent_id);
                            $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
                            $parent_id = $page->post_parent;
                        }
                        $breadcrumbs = array_reverse($breadcrumbs);
                        foreach ($breadcrumbs as $crumb) {
                            echo $crumb . ' ' . $delimiter . ' ';
                        }
                        echo $before . get_the_title() . $after;
                    } elseif (is_search()) {
                        echo $before . get_search_query() . $after;
                    } elseif (is_tag()) {
                        echo $before . single_tag_title('', false) . $after;
                    } elseif (is_author()) {
                        global $author;
                        $userdata = get_userdata($author);
                        echo $before . $userdata->display_name . $after;
                    } elseif (is_404()) {
                        echo $before . __('Error 404 ', 'vbegy') . $after;
                    } else {
                        if (is_archive()) {
                            if (is_category() || is_tag() || is_tax()) {
                                $term = $wp_query->get_queried_object();
                                $taxonomy = get_taxonomy($term->taxonomy);
                                if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent && ($parents = breadcrumbs_plus_get_term_parents($term->parent, $term->taxonomy))) {
                                    $item = array_merge($item, $parents);
                                }
                                echo $before . $term->name . $after;
                            } else {
                                if (function_exists('is_post_type_archive') && is_post_type_archive()) {
                                    $post_type_object = get_post_type_object(get_query_var('post_type'));
                                    echo $before . $post_type_object->labels->name . $after;
                                } else {
                                    if (is_date()) {
                                        if (is_day()) {
                                            echo $before . __('Archives for ', 'theme') . get_the_time('F j, Y') . $after;
                                        } elseif (is_month()) {
                                            echo $before . __('Archives for ', 'theme') . single_month_title(' ', false) . $after;
                                        } elseif (is_year()) {
                                            echo $before . __('Archives for ', 'theme') . get_the_time('Y') . $after;
                                        }
                                    } else {
                                        if (is_author()) {
                                            echo $before . __('Archives by: ', 'theme') . get_the_author_meta('display_name', $wp_query->post->post_author) . $after;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        $before = '<span class="current">';
        $after = '</span>';
        echo '<div class="clearfix"></div>
        <div class="crumbs">
        <a itemprop="breadcrumb" href="' . $homeLink . '">' . $home . '</a>' . $delimiter . ' ';
        if (is_search()) {
            echo $before . __("Search", "vbegy") . $after;
        } else {
            if (is_category() || is_tag() || is_tax()) {
                global $wp_query;
                $term = $wp_query->get_queried_object();
                $taxonomy = get_taxonomy($term->taxonomy);
                if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent && ($parents = breadcrumbs_plus_get_term_parents($term->parent, $term->taxonomy))) {
                    $item = array_merge($item, $parents);
                }
                //echo $term->name;
                echo $before . '' . single_cat_title('', false) . '' . $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;
                    if (get_post_type() == 'question') {
                        $question_category = wp_get_post_terms($post->ID, 'question-category', array("fields" => "all"));
                        if (isset($question_category[0])) {
                            ?>
                        <a href="<?php 
                            echo get_term_link($question_category[0]->slug, "question-category");
                            ?>
"><?php 
                            echo $question_category[0]->name;
                            ?>
</a>
                    <?php 
                        }
                        echo $delimiter;
                    } else {
                        if (get_post_type() == 'product') {
                            global $product;
                            echo $product->get_categories(', ', '');
                            echo $delimiter;
                        } else {
                            echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a>' . $delimiter . '';
                        }
                    }
                    echo "" . $before . get_the_title() . $after;
                } else {
                    $cat = get_the_category();
                    $cat = $cat[0];
                    echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
                    echo $before . get_the_title() . $after;
                }
            } elseif (!is_single() && !is_page() && get_post_type() != 'post') {
                if (is_author()) {
                    global $author;
                    $userdata = get_userdata($author);
                    echo $before . $userdata->display_name . $after;
                } else {
                    $post_type = get_post_type_object(get_post_type());
                    echo $before . (isset($post_type->labels->singular_name) ? $post_type->labels->singular_name : __("Error 404", "vbegy")) . $after;
                }
            } elseif (is_attachment()) {
                $parent = get_post($post->post_parent);
                $cat = get_the_category($parent->ID);
                echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a>' . $delimiter . '';
                echo $before . get_the_title() . $after;
            } elseif (is_page() && !$post->post_parent) {
                echo $before . get_the_title() . $after;
            } elseif (is_page() && $post->post_parent) {
                $parent_id = $post->post_parent;
                $breadcrumbs = array();
                while ($parent_id) {
                    $page = get_page($parent_id);
                    $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
                    $parent_id = $page->post_parent;
                }
                $breadcrumbs = array_reverse($breadcrumbs);
                foreach ($breadcrumbs as $crumb) {
                    echo $crumb . ' ' . $delimiter . ' ';
                }
                echo $before . get_the_title() . $after;
            } elseif (is_search()) {
                echo $before . __('Search results for ', 'vbegy') . '"' . get_search_query() . '"' . $after;
            } elseif (is_tag()) {
                echo $before . __('Posts tagged ', 'vbegy') . '"' . single_tag_title('', false) . '"' . $after;
            } elseif (is_author()) {
                global $author;
                $userdata = get_userdata($author);
                echo $before . $userdata->display_name . $after;
            } elseif (is_404()) {
                echo $before . __('Error 404 ', 'vbegy') . $after;
            }
        }
        if (get_query_var('paged')) {
            if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
                echo ' (';
            }
            echo "<span class='crumbs-span'>/</span><span class='current'>" . __('Page', 'vbegy') . ' ' . get_query_var('paged') . "</span>";
            if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
                echo ')';
            }
        }
        echo '</div></div></div></section></div>';
    }
}
コード例 #2
0
/**
 * Gets the items for the breadcrumbs plus.
 *
 * @since 0.4
 */
function breadcrumbs_plus_get_items($args)
{
    global $wp_query;
    $item = array();
    $show_on_front = get_option('show_on_front');
    /* Front page. */
    if (is_front_page()) {
        $item['last'] = $args['home'];
    }
    /* Link to front page. */
    if (!is_front_page()) {
        $item[] = '<a href="' . home_url('/') . '" class="home">' . $args['home'] . '</a>';
    }
    /* If bbPress is installed and we're on a bbPress page. */
    if (function_exists('is_bbpress') && is_bbpress()) {
        $item = array_merge($item, breadcrumbs_plus_get_bbpress_items());
    } elseif (is_home()) {
        $home_page = get_page($wp_query->get_queried_object_id());
        $item = array_merge($item, breadcrumbs_plus_get_parents($home_page->post_parent));
        $item['last'] = get_the_title($home_page->ID);
    } elseif (is_singular()) {
        $post = $wp_query->get_queried_object();
        $post_id = (int) $wp_query->get_queried_object_id();
        $post_type = $post->post_type;
        $post_type_object = get_post_type_object($post_type);
        if ('page' !== $wp_query->post->post_type) {
            /* If there's an archive page, add it. */
            if (function_exists('get_post_type_archive_link') && !empty($post_type_object->has_archive)) {
                $item[] = '<a href="' . get_post_type_archive_link($post_type) . '" title="' . esc_attr($post_type_object->labels->name) . '">' . $post_type_object->labels->name . '</a>';
            }
            if (isset($args["singular_{$wp_query->post->post_type}_taxonomy"]) && is_taxonomy_hierarchical($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                $terms = wp_get_object_terms($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"]);
                $item = array_merge($item, breadcrumbs_plus_get_term_parents($terms[0], $args["singular_{$wp_query->post->post_type}_taxonomy"]));
            } elseif (isset($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                $item[] = get_the_term_list($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"], '', ', ', '');
            }
        }
        if ((is_post_type_hierarchical($wp_query->post->post_type) || 'attachment' === $wp_query->post->post_type) && ($parents = breadcrumbs_plus_get_parents($wp_query->post->post_parent))) {
            $item = array_merge($item, $parents);
        }
        $item['last'] = get_the_title();
    } else {
        if (is_archive()) {
            if (is_category() || is_tag() || is_tax()) {
                $term = $wp_query->get_queried_object();
                $taxonomy = get_taxonomy($term->taxonomy);
                if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent && ($parents = breadcrumbs_plus_get_term_parents($term->parent, $term->taxonomy))) {
                    $item = array_merge($item, $parents);
                }
                $item['last'] = $term->name;
            } else {
                if (function_exists('is_post_type_archive') && is_post_type_archive()) {
                    $post_type_object = get_post_type_object(get_query_var('post_type'));
                    $item['last'] = $post_type_object->labels->name;
                } else {
                    if (is_date()) {
                        if (is_numeric(get_query_var('w') && 0 !== get_query_var('w'))) {
                            $item['last'] = sprintf(__('Weekly Archive for: ‘%s’', 'theme_front'), get_the_time('W'));
                        } elseif (is_day()) {
                            $item['last'] = sprintf(__('Daily Archive for: ‘%s’', 'theme_front'), get_the_time('F jS, Y'));
                        } elseif (is_month()) {
                            $item['last'] = sprintf(__('Monthly Archive for: ‘%s’', 'theme_front'), get_the_time('F jS, Y'));
                        } elseif (is_year()) {
                            $item['last'] = sprintf(__('Yearly Archive for: ‘%s’', 'theme_front'), get_the_time('Y'));
                        }
                    } else {
                        if (is_author()) {
                            $item['last'] = sprintf(__('Author Archive for: ‘%s’', 'theme_front'), get_the_author_meta('display_name', $wp_query->post->post_author));
                        }
                    }
                }
            }
        } else {
            if (is_search()) {
                $item['last'] = sprintf(__('Search Results for: ‘%s’', 'theme_front'), stripslashes(strip_tags(get_search_query())));
            } else {
                if (is_404()) {
                    $item['last'] = __('Page Not Found', 'theme_front');
                }
            }
        }
    }
    return apply_filters('breadcrumbs_plus_items', $item);
}
コード例 #3
0
/**
 * Gets the items for the breadcrumbs plus.
 *
 * @since 0.4
 */
function breadcrumbs_plus_get_items($args)
{
    global $wp_query;
    $item = array();
    $show_on_front = get_option('show_on_front');
    /* Front page. */
    if (is_front_page()) {
        $item['last'] = $args['home'];
    }
    /* Link to front page. */
    if (!is_front_page()) {
        $item[] = '<div class="vbreadcrumb" typeof="v:Breadcrumb"><a href="' . home_url('/') . '" rel="v:url" property="v:title" class="home">' . $args['home'] . '</a></div>';
    }
    /* If bbPress is installed and we're on a bbPress page. */
    if (function_exists('is_bbpress') && is_bbpress()) {
        $item = array_merge($item, breadcrumbs_plus_get_bbpress_items());
    } elseif (is_home()) {
        $home_page = get_page($wp_query->get_queried_object_id());
        $item = array_merge($item, breadcrumbs_plus_get_parents($home_page->post_parent));
        $item['last'] = get_the_title($home_page->ID);
    } elseif (is_singular()) {
        $post = $wp_query->get_queried_object();
        $post_id = (int) $wp_query->get_queried_object_id();
        $post_type = $post->post_type;
        $post_type_object = get_post_type_object($post_type);
        if ('post' === $wp_query->post->post_type && $args['show_blog']) {
            $item[] = '<div class="vbreadcrumb" typeof="v:Breadcrumb"><a href="' . get_permalink(get_option('page_for_posts')) . '" rel="v:url" property="v:title">' . get_the_title(get_option('page_for_posts')) . '</a></div>';
        }
        if ('page' !== $wp_query->post->post_type) {
            /* If there's an archive page, add it. */
            if (function_exists('get_post_type_archive_link') && !empty($post_type_object->has_archive)) {
                $item[] = '<div class="vbreadcrumb" typeof="v:Breadcrumb"><a href="' . get_post_type_archive_link($post_type) . '" title="' . esc_attr($post_type_object->labels->name) . '" rel="v:url" property="v:title">' . $post_type_object->labels->name . '</a></div>';
            }
            if (isset($args["singular_{$wp_query->post->post_type}_taxonomy"]) && is_taxonomy_hierarchical($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                $terms = wp_get_object_terms($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"]);
                $item = array_merge($item, breadcrumbs_plus_get_term_parents($terms[0], $args["singular_{$wp_query->post->post_type}_taxonomy"]));
            } elseif (isset($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                $item[] = get_the_term_list($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"], '', ', ', '');
            }
        }
        if ((is_post_type_hierarchical($wp_query->post->post_type) || 'attachment' === $wp_query->post->post_type) && ($parents = breadcrumbs_plus_get_parents($wp_query->post->post_parent))) {
            $item = array_merge($item, $parents);
        }
        $item['last'] = '';
    } else {
        if (is_archive()) {
            if (is_category() || is_tag() || is_tax()) {
                $term = $wp_query->get_queried_object();
                $taxonomy = get_taxonomy($term->taxonomy);
                if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent && ($parents = breadcrumbs_plus_get_term_parents($term->parent, $term->taxonomy))) {
                    $item = array_merge($item, $parents);
                }
                $item['last'] = $term->name;
            } else {
                if (function_exists('is_post_type_archive') && is_post_type_archive()) {
                    $post_type_object = get_post_type_object(get_query_var('post_type'));
                    $item['last'] = $post_type_object->labels->name;
                } else {
                    if (is_date()) {
                        if (is_day()) {
                            $item['last'] = __('Archives for ', 'framework') . get_the_time('F j, Y');
                        } elseif (is_month()) {
                            $item['last'] = __('Archives for ', 'framework') . single_month_title(' ', false);
                        } elseif (is_year()) {
                            $item['last'] = __('Archives for ', 'framework') . get_the_time('Y');
                        }
                    } else {
                        if (is_author()) {
                            $item['last'] = __('Archives by: ', 'framework') . get_the_author_meta('display_name', $wp_query->post->post_author);
                        }
                    }
                }
            }
        } else {
            if (is_search()) {
                $item['last'] = __('Search results for "', 'framework') . stripslashes(strip_tags(get_search_query())) . '"';
            } else {
                if (is_404()) {
                    $item['last'] = __('Page Not Found', 'framework');
                }
            }
        }
    }
    return apply_filters('breadcrumbs_plus_items', $item);
}
コード例 #4
0
 /**
  * Shows a breadcrumb for all types of pages.
  *
  * @since 0.1
  * @param array $args
  * @return string
  */
 function breadcrumbs_plus($args = '')
 {
     global $wp_query;
     $domain = 'breadcrumbs-plus';
     /* Set up the default arguments for the breadcrumb. */
     $defaults = array('prefix' => '<p id="breadcrumbs">', 'suffix' => '</p>', 'title' => __('You are here: ', 'wt_front'), 'home' => __('Home', 'wt_front'), 'sep' => false, 'front_page' => false, 'bold' => false, 'show_blog' => false, 'singular_post_taxonomy' => 'category', 'singular_portfolio_taxonomy' => 'portfolio_category', 'singular_product_taxonomy' => 'product_cat', 'echo' => true);
     $args = apply_filters('breadcrumbs_plus_args', $args);
     $args = wp_parse_args($args, $defaults);
     if (is_front_page() && !$args['front_page']) {
         return apply_filters('breadcrumbs_plus', false);
     }
     /* Format the title. */
     $html = !empty($args['title']) ? '<span class="breadcrumbs-title">' . $args['title'] . '</span>' : '';
     /* Format the separator. */
     $separator = !empty($args['sep']) ? ' <span class="breadcrumbs-separator">' . $args['sep'] . '</span> ' : ' <span class="breadcrumbs-separator">/</span> ';
     $show_on_front = get_option('show_on_front');
     $home = '<a href="' . home_url('/') . '" rel="home" class="breadcrumbs-begin">' . $args['home'] . '</a>';
     if ('page' == $show_on_front && $args['show_blog']) {
         $bloglink = $home . $separator . '<a href="' . get_permalink(get_option('page_for_posts')) . '">' . get_the_title(get_option('page_for_posts')) . '</a>';
     } else {
         $bloglink = $home;
     }
     if (is_front_page()) {
         $html .= _bold_($home, $args['bold']);
     } elseif (is_home()) {
         $html .= $home . $separator . _bold_(get_the_title(get_option('page_for_posts')), $args['bold']);
     } elseif (is_singular()) {
         $post_id = (int) $wp_query->get_queried_object_id();
         if ('page' === $wp_query->post->post_type) {
             $html .= $home . $separator;
         } elseif ('page' !== $wp_query->post->post_type && $wp_query->post->post_type != 'portfolio' && $wp_query->post->post_type != 'product') {
             $html .= $bloglink . $separator;
             if (isset($args["singular_{$wp_query->post->post_type}_taxonomy"]) && is_taxonomy_hierarchical($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                 $terms = wp_get_object_terms($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"]);
                 $html .= breadcrumbs_plus_get_term_parents($terms[0], $args["singular_{$wp_query->post->post_type}_taxonomy"], $separator) . $separator;
             } elseif (isset($args["singular_{$wp_query->post->post_type}_taxonomy"])) {
                 $html .= get_the_term_list($post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"], '', ', ', '') . $separator;
             }
         } elseif ('portfolio' === $wp_query->post->post_type) {
             $html .= $home . $separator;
             if (isset($args["singular_portfolio_taxonomy"]) && is_taxonomy_hierarchical($args["singular_portfolio_taxonomy"])) {
                 $terms = wp_get_object_terms($post_id, $args["singular_portfolio_taxonomy"]);
                 if (!empty($terms[0])) {
                     $html .= breadcrumbs_plus_get_term_parents($terms[0], $args["singular_portfolio_taxonomy"], $separator) . $separator;
                 }
             } elseif (isset($args["singular_portfolio_taxonomy"])) {
                 $html .= get_the_term_list($post_id, $args["singular_portfolio_taxonomy"], '', ', ', '') . $separator;
             }
         } elseif ('product' === $wp_query->post->post_type) {
             $shop = $home . $separator . '<a href="' . get_permalink(get_option('woocommerce_shop_page_id')) . '">' . get_the_title(get_option('woocommerce_shop_page_id')) . '</a>';
             $html .= $shop . $separator;
             if (isset($args["singular_product_taxonomy"]) && is_taxonomy_hierarchical($args["singular_product_taxonomy"])) {
                 $terms = wp_get_object_terms($post_id, $args["singular_product_taxonomy"]);
                 if (!empty($terms[0])) {
                     $html .= breadcrumbs_plus_get_term_parents($terms[0], $args["singular_product_taxonomy"], $separator) . $separator;
                 }
             } elseif (isset($args["singular_product_taxonomy"])) {
                 $html .= get_the_term_list($post_id, $args["singular_product_taxonomy"], '', ', ', '') . $separator;
             }
         }
         if ((is_post_type_hierarchical($wp_query->post->post_type) || 'attachment' === $wp_query->post->post_type) && ($parents = breadcrumbs_plus_get_parents($wp_query->post->post_parent, $separator))) {
             $html .= $parents . $separator;
         }
         $html .= _bold_(get_the_title(), $args['bold']);
     } elseif (is_search()) {
         $html .= $home . $separator . _bold_(__('Search results for "', 'breadcrumbs-plus') . stripslashes(strip_tags(get_search_query())) . '"', $args['bold']);
     } elseif (is_archive()) {
         if ('portfolio' === $wp_query->post->post_type) {
             $html .= $home . $separator;
         } elseif ('product' === $wp_query->post->post_type) {
             if (!is_shop()) {
                 $shop = $home . $separator . '<a href="' . get_permalink(get_option('woocommerce_shop_page_id')) . '">' . get_the_title(get_option('woocommerce_shop_page_id')) . '</a>';
                 $html .= $shop . $separator;
             } else {
                 $html .= $home . $separator;
             }
         } else {
             $html .= $bloglink . $separator;
         }
         if (is_category() || is_tag() || is_tax() || 'portfolio' === $wp_query->post->post_type) {
             $term = $wp_query->get_queried_object();
             $taxonomy = get_taxonomy($term->taxonomy);
             if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent && ($parents = breadcrumbs_plus_get_term_parents($term->parent, $term->taxonomy, $separator))) {
                 $html .= $parents . $separator;
             }
             $html .= _bold_($term->name, $args['bold']);
         } elseif (function_exists('is_post_type_archive') && is_post_type_archive()) {
             $post_type_object = get_post_type_object(get_query_var('post_type'));
             $html .= _bold_($post_type_object->labels->name, $args['bold']);
         } elseif (is_date()) {
             if (is_day()) {
                 $html .= _bold_(__('Archives for ', 'breadcrumbs-plus') . get_the_time('F j, Y'), $args['bold']);
             } elseif (is_month()) {
                 $html .= _bold_(__('Archives for ', 'breadcrumbs-plus') . single_month_title(' ', false), $args['bold']);
             } elseif (is_year()) {
                 $html .= _bold_(__('Archives for ', 'breadcrumbs-plus') . get_the_time('Y'), $args['bold']);
             }
         } elseif (is_author()) {
             $html .= _bold_(__('Archives by: ', 'breadcrumbs-plus') . get_the_author_meta('display_name', $wp_query->post->post_author), $args['bold']);
         }
     } elseif (is_404()) {
         $html .= $home . $separator . _bold_(__('Page Not Found', 'breadcrumbs-plus'), $args['bold']);
     }
     $breadcrumbs = '<div id="breadcrumbs"><div class="breadcrumbs-plus">';
     $breadcrumbs .= $args['prefix'];
     $breadcrumbs .= $html;
     $breadcrumbs .= $args['suffix'];
     $breadcrumbs .= '</div></div>';
     $breadcrumbs = apply_filters('breadcrumbs_plus', $breadcrumbs);
     if (!$args['echo']) {
         return $breadcrumbs;
     }
     echo $breadcrumbs . "\n";
 }