• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Parsed Source / Parsed: 49907
  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 );

  }
 

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Source ref: Genesis_Breadcrumb::get_page_crumb() – Return content page breadcrumb.
Parse count / Source file date: 1569839049
MD5 hash: f3695cb25849e18c2566088f6368e4b2

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.9.3
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites