From cd1427fe2b80781093e2f5af298a775c742f68be Mon Sep 17 00:00:00 2001 From: Bernat Date: Thu, 17 Apr 2025 12:18:13 +0200 Subject: [PATCH] Included podcasts to breadcrumbs --- themes/osi/template-parts/breadcrumbs.php | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/themes/osi/template-parts/breadcrumbs.php b/themes/osi/template-parts/breadcrumbs.php index 409ee59..1b12085 100644 --- a/themes/osi/template-parts/breadcrumbs.php +++ b/themes/osi/template-parts/breadcrumbs.php @@ -8,7 +8,31 @@ $post_type = is_page() ? 'page' : get_query_var( 'post_type' ); $is_post_type_hierarchical = is_post_type_hierarchical( $post_type ); + // Special handling for podcast post type + if ( $post_type === 'podcast' ) { + $breadcrumb = ''; + $position = 1; + $podcast_archive_url = home_url( '/ai/podcast/' ); + + if ( is_archive() || is_post_type_archive( 'podcast' ) ) { + $breadcrumb .= 'Podcast'; + } else { + $breadcrumb .= 'Podcast'; + ++$position; + + $post_id = get_queried_object_id(); + $breadcrumb .= '' . esc_html( get_the_title( $post_id ) ) . ''; + } + + $home = '' . esc_html__( 'Home', 'jetpack' ) . ''; + + echo ''; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo ''; // Close the breadcrumb area + return; + } + if ( ! ( $is_post_type_hierarchical || $is_taxonomy_hierarchical ) || is_front_page() ) { + echo ''; // Close the breadcrumb area return; }