diff --git a/wp-content/themes/pub/wporg-learn-2024/functions.php b/wp-content/themes/pub/wporg-learn-2024/functions.php
index 54a6cd3ae..2d4b7c1a3 100644
--- a/wp-content/themes/pub/wporg-learn-2024/functions.php
+++ b/wp-content/themes/pub/wporg-learn-2024/functions.php
@@ -14,6 +14,7 @@
require_once __DIR__ . '/src/upcoming-online-workshops/index.php';
require_once __DIR__ . '/src/sensei-meta-list/index.php';
require_once __DIR__ . '/inc/block-config.php';
+require_once __DIR__ . '/inc/block-hooks.php';
require_once __DIR__ . '/inc/query.php';
/**
@@ -221,9 +222,9 @@ function get_learning_pathway_level_content( $learning_pathway ) {
/**
* Filters breadcrumb items for the site-breadcrumb block.
*
- * @param array $breadcrumbs
+ * @param array $breadcrumbs The current breadcrumbs.
*
- * @return array
+ * @return array The modified breadcrumbs.
*/
function set_site_breadcrumbs( $breadcrumbs ) {
if ( isset( $breadcrumbs[0] ) ) {
@@ -274,6 +275,28 @@ function set_site_breadcrumbs( $breadcrumbs ) {
$breadcrumbs[1] = $archive_breadcrumb;
array_splice( $breadcrumbs, 2, 0, array( $lesson_course_breadcrumb ) );
}
+ } else {
+ // Add the ancestors of the current page to the breadcrumbs.
+ $ancestors = get_post_ancestors( get_the_ID() );
+
+ if ( ! empty( $ancestors ) ) {
+ foreach ( $ancestors as $ancestor ) {
+ $ancestor_post = get_post( $ancestor );
+
+ $ancestor_breadcrumb = array(
+ 'url' => get_permalink( $ancestor_post ),
+ 'title' => get_the_title( $ancestor_post ),
+ );
+
+ array_splice( $breadcrumbs, 1, 0, array( $ancestor_breadcrumb ) );
+ }
+ }
+ }
+
+ // Ensure breadcrumbs are displayed only when there are at least 3 levels.
+ $breadcrumb_level = count( $breadcrumbs );
+ if ( $breadcrumb_level < 3 ) {
+ $breadcrumbs = array();
}
return $breadcrumbs;
diff --git a/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php b/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php
new file mode 100644
index 000000000..223dc4b26
--- /dev/null
+++ b/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/themes/pub/wporg-learn-2024/parts/header-second-post-title.html b/wp-content/themes/pub/wporg-learn-2024/parts/header-second-post-title.html
new file mode 100644
index 000000000..bfc11b65f
--- /dev/null
+++ b/wp-content/themes/pub/wporg-learn-2024/parts/header-second-post-title.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/themes/pub/wporg-learn-2024/parts/header-second.html b/wp-content/themes/pub/wporg-learn-2024/parts/header-second.html
new file mode 100644
index 000000000..02040da00
--- /dev/null
+++ b/wp-content/themes/pub/wporg-learn-2024/parts/header-second.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/themes/pub/wporg-learn-2024/parts/header-third-archive-title.html b/wp-content/themes/pub/wporg-learn-2024/parts/header-third-archive-title.html
new file mode 100644
index 000000000..96c3d0ae5
--- /dev/null
+++ b/wp-content/themes/pub/wporg-learn-2024/parts/header-third-archive-title.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/themes/pub/wporg-learn-2024/parts/header-third-post-title.html b/wp-content/themes/pub/wporg-learn-2024/parts/header-third-post-title.html
new file mode 100644
index 000000000..96231a0c4
--- /dev/null
+++ b/wp-content/themes/pub/wporg-learn-2024/parts/header-third-post-title.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/themes/pub/wporg-learn-2024/parts/header.html b/wp-content/themes/pub/wporg-learn-2024/parts/header.html
index 5eeff5046..02040da00 100644
--- a/wp-content/themes/pub/wporg-learn-2024/parts/header.html
+++ b/wp-content/themes/pub/wporg-learn-2024/parts/header.html
@@ -1,14 +1,10 @@
-
+
-
-
-
-
diff --git a/wp-content/themes/pub/wporg-learn-2024/patterns/sensei-lesson-header.php b/wp-content/themes/pub/wporg-learn-2024/patterns/sensei-lesson-header.php
index f36d3b52f..21f27b5c6 100644
--- a/wp-content/themes/pub/wporg-learn-2024/patterns/sensei-lesson-header.php
+++ b/wp-content/themes/pub/wporg-learn-2024/patterns/sensei-lesson-header.php
@@ -15,11 +15,7 @@