protected function get_page_crumb() { global $wp_query; if ( $this->page_shown_on_front() && is_front_page() ) { // Don't do anything - we're on the front page and we've already dealt with that elsewhere. $crumb = $this->get_home_crumb(); } else { $post = $wp_query->get_queried_object(); if ( $post->post_parent ) { if ( isset( $post->ancestors ) ) { if ( is_array( $post->ancestors ) ) { $ancestors = array_values( $post->ancestors ); } else { $ancestors = [ $post->ancestors ]; } } else { $ancestors = [ $post->post_parent ]; } $crumbs = []; foreach ( $ancestors as $ancestor ) { array_unshift( $crumbs, $this->get_breadcrumb_link( get_permalink( $ancestor ), '', get_the_title( $ancestor ) ) ); } // Add the current page title. $crumbs[] = get_the_title( $post->ID ); $crumb = implode( $this->args['sep'], $crumbs ); } else { // If this is a top level Page, it's simple to output the breadcrumb. $crumb = get_the_title(); } } /** * Filter the content page breadcrumb. * * @since 1.5.0 * * @param string $crumb HTML markup for the content page breadcrumb. * @param array $args Arguments used to generate the breadcrumbs. Documented in Genesis_Breadcrumbs::get_output(). */ return apply_filters( 'genesis_page_crumb', $crumb, $this->args ); }