HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34
System: Linux atalantini.com 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64
User: root (0)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: //opt/blanc/breadcrumbs-item.php
<?php
/**
 * The template for displaying breadcrumbs for Welcart e-commerce plugin posts/pages.
 * @link       http://welcustom.net/
 * @author      Mamekko
 * @copyright   Copyright (c)2014 welcustom.net
 */

global $post;
$str ='';
if(!is_home()&&!is_admin()){
    $str.= '<ol id="breadcrumbs" class="clearfix">';
    $str.= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="'. home_url() .'/" itemprop="url"><span itemprop="title">' .__( "Home", "blanc" ). '</span></a></li>';
    if(is_search()){
        $s_word = get_search_query();
        $str.='<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">' .sprintf(__("Results for '%s'", "blanc"), $s_word ). '</li>';
    } elseif(is_tag()){
        $str.='<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">' .__( "Tag:", "blanc" ) . single_tag_title( '' , false ). '</span></li>';
    } elseif(is_category()) {
        $cat = get_queried_object();
        $str.='<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">'. $cat -> name;
        if( is_paged()){
            $current = (get_query_var('paged')) ? get_query_var('paged') : 1;
            $str.= sprintf(__(" - Page %d", "blanc"), $current );
        }
        $str.='</span></li>';
    } elseif(is_single()){
        $str .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">';
        $cats = '';
        $categories = get_the_category();
        foreach( $categories as $category){
            $category_id = $category->term_id;
            $category_child = get_term_children($category_id, 'category');
            if($category_child != true){
                $cats .= '<a href="'. get_category_link($category_id) .'" itemprop="url"><span itemprop="title">' . get_cat_name($category_id) . '</span></a>&nbsp;/&nbsp;';
            }
        }
        $str.= rtrim( $cats, '&nbsp;/&nbsp;' );
        $str.= '</li>';
        $str.= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">'. $post -> post_title .'</span></li>';
    } else{
        $str.='<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">'. wp_title('', false) .'</span></li>';
    }
    $str.='</ol>';
}
echo $str;