In this article, we’re learning how to add breadcrumbs to posts and other custom post types in Page Builder Framework. There are several ways to add breadcrumbs to your website, we recommend yoast SEO which we will be using in this example.

After you have installed and activated yoast SEO, you will need to enable advanced options to use their breadcrumbs functionality.

yoast SEO – enable advanced settings

Navigate to SEO -> Advanced. From there, you can access the Breadcrumbs settings. Enable breadcrumbs and hit save.

yoast SEO breadcrumbs

Add Breadcrumbs to Page Builder Framework

Now, we’re going to use one of the built in hooks in Page Builder Framework to display the breadcrumbs on every post before the article. The code we’re hooking in is coming from the yoast SEO knowledge base. You can find the full article here.

add_action( 'wpbf_before_article', 'wpbf_breadcrumbs' );
function wpbf_breadcrumbs() {
	if ( function_exists( 'yoast_breadcrumb' ) ) {
		yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );