• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Editing Breadcrumb Output

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Editing Breadcrumb Output

This topic is: not resolved

Tagged: breadcrumb

  • This topic has 2 replies, 2 voices, and was last updated 13 years, 7 months ago by ElwoodP.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 22, 2013 at 9:58 am #30450
    ElwoodP
    Member

    I have some pages on a site that are split into multiple sections using <!--nextpage-->. I wanted to edit the genesis breadcrumb output to reflect which section of the page I was currently on.

    I've successfully achieved this (with some very rudimentary php skills!) by editing the function get_page_crumb() found in breadcrumb.php class.

    It works but obviously I don't want to leave edits in the core genesis file. How do I overwrite the function from my themes functions.php?

    function get_page_crumb() {

    global $wp_query, $page, $numpages;

    if ( 'page' == $this->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 this is a top level Page, it's simple to output the breadcrumb */
    if ( 0 == $post->post_parent ) {
    $crumb = get_the_title();
    } else {
    if ( isset( $post->ancestors ) ) {
    if ( is_array( $post->ancestors ) )
    $ancestors = array_values( $post->ancestors );
    else
    $ancestors = array( $post->ancestors );
    } else {
    $ancestors = array( $post->post_parent );
    }

    $crumbs = array();
    foreach ( $ancestors as $ancestor ) {
    array_unshift(
    $crumbs,
    $this->get_breadcrumb_link(
    get_permalink( $ancestor ),
    sprintf( __( 'View %s', 'genesis' ), get_the_title( $ancestor ) ),
    get_the_title( $ancestor )
    )
    );
    }

    /** Add the current page title */

    if ($numpages > 1) {
    $crumbs[] = '<a href="' . get_permalink( $post ) . '">' . get_the_title( $post->ID ) . '</a> » Part ' . $page;
    } else {
    $crumbs[] = get_the_title( $post->ID );
    }

    $crumb = join( $this->args['sep'], $crumbs );
    }
    }

    return apply_filters( 'genesis_page_crumb', $crumb, $this->args );

    }
    }

    March 22, 2013 at 2:33 pm #30558
    AnitaC
    Keymaster

    Here's some snippets that might help you - http://my.studiopress.com/snippets/breadcrumbs/. And also this - http://code.garyjones.co.uk/modify-breadcrumb-display, and one more here - http://www.wpsyntax.com/wordpress/customize-genesis-breadcrumb.


    Need help with customization or troubleshooting? Reach out to me.

    March 22, 2013 at 3:29 pm #30573
    ElwoodP
    Member

    Thanks Antiac I'm not sure that helps. As far as I can work out I can use filters to change various static parts of the breadcrumb but I can't use filters to achieve what I'm after?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble