title: full path in breadcrumbs wordpress
body: <p>I want to take a full path in bread crumbs in the wordpress template</p>
  
  <p>Now displays only the home page and category</p>
  
  <p>I want the home - category - the title of the article with the link to this page, with a working schema markup</p>
  
  <p>now the code looks like this
  version Wordpress 4.8.1</p>
  
  <pre><code>function barcelona_breadcrumb() {
      if ( barcelona_get_option( 'show_breadcrumb' ) != 'on' ) {
          return;
      }
      $barcelona_post_type = is_single() ? get_post_type() : NULL;
      $barcelona_sep_icon = '';
      $barcelona_items = '';
      if ( ( is_single() &amp;&amp; $barcelona_post_type == 'post' &amp;&amp; ! is_attachment() ) || is_category() ) {
          $barcelona_categories = is_category() ? array() : get_the_category();
          $barcelona_current_cat = $barcelona_last_cat = is_category() ? get_queried_object() : $barcelona_categories[0];
          $barcelona_counter = 3;
          while ( $barcelona_current_cat-&gt;category_parent != '0' ) {
              $barcelona_current_cat = get_category( $barcelona_current_cat-&gt;category_parent );
              $barcelona_items = $barcelona_sep_icon .'&lt;li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"&gt;&lt;a itemprop="item" href="'. esc_url( get_category_link( $barcelona_current_cat ) ) .'"&gt;&lt;span itemprop="name"&gt;'. esc_html( $barcelona_current_cat-&gt;name ) .'&lt;/span&gt;&lt;/a&gt;&lt;meta itemprop="position" content="%'. $barcelona_counter .'%" /&gt;&lt;/li&gt;'. $barcelona_items;
              $barcelona_counter++;
          }
          $barcelona_items .= $barcelona_sep_icon .'&lt;li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"&gt;&lt;'. ( is_category() ? 'span' : 'a href="'. esc_url( get_category_link( $barcelona_last_cat ) ) .'"' ) .' itemprop="item"&gt;&lt;span itemprop="name"&gt;'. esc_html( $barcelona_last_cat-&gt;name ) .'&lt;/span&gt;&lt;/'. ( is_category() ? 'span' : 'a' ) .'&gt;&lt;meta itemprop="position" content="%2%" /&gt;&lt;/li&gt;';
              if ( $barcelona_counter &gt; 3 ) {
              $barcelona_arr = array_reverse( range( 2, $barcelona_counter - 1 ) );
              foreach( $barcelona_arr as $k =&gt; $v ) {
                  $barcelona_items = str_replace( 'itemprop="position" content="%'. intval( $k + 2 ) .'%"', 'itemprop="position" content="'. intval( $v ) .'"', $barcelona_items );
              }
          } else {
              $barcelona_items = str_replace( 'content="%2%"', 'content="2"', $barcelona_items );
          }
      } else if ( is_archive() || is_search() ) {
          $barcelona_title = is_search() ? esc_html__( 'Search Results', 'barcelona' ) : esc_html( get_the_archive_title() );
          if ( is_author() ) {
              $barcelona_title = esc_html__( 'Author Archive', 'barcelona' );
          } else if ( is_year() ) {
              $barcelona_title = esc_html__( 'Yearly Archive', 'barcelona' );
          } else if ( is_month() ) {
              $barcelona_title = esc_html__( 'Monthly Archive', 'barcelona' );
          } else if ( is_day() ) {
              $barcelona_title = esc_html__( 'Daily Archive', 'barcelona' );
          } else if ( is_tag() ) {
              $barcelona_title = esc_html__( 'Tag Archive', 'barcelona' );
          }
          $barcelona_items .= $barcelona_sep_icon .'&lt;li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"&gt;&lt;span itemprop="item"&gt;&lt;span itemprop="name"&gt;'. $barcelona_title .'&lt;/span&gt;&lt;/span&gt;&lt;meta itemprop="position" content="2" /&gt;&lt;/li&gt;';
      }
      $barcelona_items = '&lt;li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"&gt;&lt;a itemprop="item" href="'. esc_url( home_url( '/' ) ) .'"&gt;'. esc_html__( 'Home', 'barcelona' ) .'&lt;/a&gt;&lt;meta itemprop="position" content="1" /&gt;&lt;/li&gt;'. $barcelona_items;
          echo '&lt;div class="breadcrumb-wrapper"&gt;&lt;div class="container"&gt;&lt;ol itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumb"&gt;'. $barcelona_items .'&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;';
  }
  </code></pre>
  
  <p>Thanks!</p>