Skip to content

Snippet: Auto Locate Post Type Parent Page for Breadcrumbs

// If enabled it will try and locate a page with the same slug as your post type and add it to the breadcrumbs
add_filter( 'wpex_breadcrumbs_args', function( $args ) {
    $args['cpt_find_parents'] = true;
    return $args;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top