/var/www/html_us/wp-content/themes/elessi-theme/woocommerce/global/breadcrumb.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php

/**
 * Breadcrumb
 *
 * @author  NasaTheme
 * @package Elessi-theme/WooCommerce
 * @version 2.3.0
 */

if (!defined('ABSPATH')) :
    exit; 
// Exit if accessed directly
endif;

if (!empty(
$breadcrumb)) {
    global 
$post$nasa_opt$wp_query;
    
    
/**
     * Breadcrumb single row
     */
    
if (isset($row) && $row == 'single') {
        
/**
         * Remove title in archive Products page
         */
        
add_filter('woocommerce_show_page_title''__return_false');
        
        
/**
         * Single Portfolio
         */
        
if (is_singular('portfolio')) {
            
$breadcrumb elessi_rebuilt_breadcrumb_portfolio($breadcrumbtrue);
        }

        
/**
         * Archive Portfolio
         */
        
else {
            
$queried_object $wp_query->get_queried_object();

            if (isset(
$queried_object->taxonomy) && $queried_object->taxonomy == 'portfolio_category') {
                
$breadcrumb elessi_rebuilt_breadcrumb_portfolio($breadcrumbfalse);
            }
        }

        echo 
$wrap_before;

        
$key 0;
        
$sizeof sizeof($breadcrumb);
        foreach (
$breadcrumb as $crumb) {
            echo 
$before;

            echo (!empty(
$crumb[1]) && $sizeof !== $key 1) ?
                
'<a href="' esc_url($crumb[1]) . '" title="' esc_attr($crumb[0]) . '">' .
                    
esc_html($crumb[0]) .
                
'</a>' esc_html($crumb[0]);

            echo 
$after;

            if (
$sizeof !== $key 1) {
                echo 
$delimiter;
            }

            
$key++;
        }

        echo 
$wrap_after;
    }
    
    
/**
     * Breadcrumb double row
     */
    
else {
        
$queried_object $wp_query->get_queried_object();

        
$title '';
        
$count count($breadcrumb);

        
/**
         * Single product - Single post
         */
        
if (is_product() || is_singular('post')) {
            if (isset(
$breadcrumb[$count-1][1])) {
                unset(
$breadcrumb[$count-1][1]);
            }

            
$h2 $breadcrumb[$count-1];
            unset(
$breadcrumb[$count-1]);

            
$title = isset($h2[0]) ? esc_html($h2[0]) : '';
        }
        

        
/**
         * Single Portfolio
         */
        
elseif (is_singular('portfolio')) {
            
$title get_the_title();
            
$breadcrumb elessi_rebuilt_breadcrumb_portfolio($breadcrumbtrue);
        }

        
/**
         * Archive Portfolio
         */
        
elseif (isset($queried_object->taxonomy) && $queried_object->taxonomy == 'portfolio_category') {
            
$title $queried_object->name;
            
$breadcrumb elessi_rebuilt_breadcrumb_portfolio($breadcrumbfalse);
        }

        
/**
         * page Other
         */
        
else {
            if (
$count 1) {
                
$endBreadcrumb $breadcrumb[$count 1];
                unset(
$breadcrumb[$count 1]);
                
$title esc_html($endBreadcrumb[0]);

                
/**
                 * Page search
                 */
                
if (is_search() && $count && isset($breadcrumb[$count-2][1])) {
                    unset(
$breadcrumb[$count-2][1]);
                }
            }
        }
        
        if (
$title) {
            
$tag_html 'span';
            
            if (
NASA_WOO_ACTIVED && (is_shop() || is_product_taxonomy())) {
                
$tag_html 'h1';
                
                
/**
                 * Remove title in archive Products page
                 */
                
add_filter('woocommerce_show_page_title''__return_false');
            }
            
            
$tag_html apply_filters('nasa_tag_first_breadcrumb'$tag_html);
            echo 
'<' $tag_html ' class="nasa-first-breadcrumb">' $before $title $after '</' $tag_html '>';
        }

        echo 
$wrap_before;

        
$key 0;
        
$sizeof sizeof($breadcrumb);
        
        foreach (
$breadcrumb as $crumb) {
            echo 
$before;
            echo (!empty(
$crumb[1])) ? '<a href="' esc_url($crumb[1]) . '" title="' esc_attr($crumb[0]) . '">' esc_html($crumb[0]) . '</a>' esc_html($crumb[0]);
            echo 
$after;
            echo (
$sizeof !== $key 1) ? $delimiter '';

            
$key++;
        }

        echo 
$wrap_after;
    }
}