Breadcrumbs

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>' );
	}
}
Page Builder Framework

A Page Builder’s best friend.

Sign up for the Newsletter

Get notified about the latest features and updates.

Join the Community

Cookie Preference

Please select an option. You can find more information about the consequences of your choice at Help. Privacy Policy | Imprint

Select an option to continue

Your selection was saved!

Help

Help

To continue, you must make a cookie selection. Below is an explanation of the different options and their meaning.

  • Accept cookies:
    All cookies such as tracking and analytics cookies.
  • Reject tracking cookies:
    No cookies except for those necessary for technical reasons are set.

You can change your cookie setting here anytime: Privacy Policy. Imprint

Back