# Rank Math Breadcrumbs: Parent Page for a Post Type

> Shows a regular page before custom post type entries in Rank Math breadcrumbs, such as Home > Our Team > Jane Doe.

- Type: PHP
- Runs: Frontend only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: rank-math, breadcrumbs, custom-post-types
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rankmath-breadcrumb-post-type-parent/

## Code

```php
// Post type => ID of the page to show before it.
$wpide_rm_crumb_parents = array(
    'team' => 42,
);

add_filter( 'rank_math/frontend/breadcrumb/items', function ( $crumbs ) use ( $wpide_rm_crumb_parents ) {
    if ( ! is_array( $crumbs ) || ! is_singular( array_keys( $wpide_rm_crumb_parents ) ) ) {
        return $crumbs;
    }

    $page_id = (int) $wpide_rm_crumb_parents[ get_post_type() ];

    if ( $page_id && 'publish' === get_post_status( $page_id ) ) {
        array_splice( $crumbs, 1, 0, array( array( get_the_title( $page_id ), get_permalink( $page_id ), 'hide_in_schema' => false ) ) );
    }

    return $crumbs;
} );
```

## Notes

Map each post type to the ID of the page that acts as its parent.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Rank Math Breadcrumbs: Parent Page for a Post Type" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
