File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
themes/osi/template-parts Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 88 $ post_type = is_page () ? 'page ' : get_query_var ( 'post_type ' );
99 $ is_post_type_hierarchical = is_post_type_hierarchical ( $ post_type );
1010
11+ // Special handling for podcast post type
12+ if ( $ post_type === 'podcast ' ) {
13+ $ breadcrumb = '' ;
14+ $ position = 1 ;
15+ $ podcast_archive_url = home_url ( '/ai/podcast/ ' );
16+
17+ if ( is_archive () || is_post_type_archive ( 'podcast ' ) ) {
18+ $ breadcrumb .= '<span class="current-page" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta itemprop="position" content=" ' . esc_attr ( $ position ) . '"><span itemprop="name">Podcast</span></span> ' ;
19+ } else {
20+ $ breadcrumb .= '<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta itemprop="position" content=" ' . esc_attr ( $ position ) . '"><a href=" ' . esc_url ( $ podcast_archive_url ) . '" itemprop="item"><span itemprop="name">Podcast</span></a></span> ' ;
21+ ++$ position ;
22+
23+ $ post_id = get_queried_object_id ();
24+ $ breadcrumb .= '<span class="current-page" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta itemprop="position" content=" ' . esc_attr ( $ position ) . '"><span itemprop="name"> ' . esc_html ( get_the_title ( $ post_id ) ) . '</span></span> ' ;
25+ }
26+
27+ $ home = '<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta itemprop="position" content="0"><a href=" ' . esc_url ( home_url ( '/ ' ) ) . '" class="home-link" itemprop="item" rel="home"><span itemprop="name"> ' . esc_html__ ( 'Home ' , 'jetpack ' ) . '</span></a></span> ' ;
28+
29+ echo '<nav class="entry-breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList"> ' . $ home . $ breadcrumb . '</nav> ' ; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
30+ echo '</div></div> ' ; // Close the breadcrumb area
31+ return ;
32+ }
33+
1134 if ( ! ( $ is_post_type_hierarchical || $ is_taxonomy_hierarchical ) || is_front_page () ) {
35+ echo '</div></div> ' ; // Close the breadcrumb area
1236 return ;
1337 }
1438
You can’t perform that action at this time.
0 commit comments