How To Add Yoast Breadcrumbs To The GeneratePress Theme

Need to enable breadcrumbs in the GeneratePress theme?

If your using the GeneratePress theme (the premium version) and of course the Yoast SEO plugin, this tutorial is for you.

GeneratePress is quite frankly hands down the best WordPress theme I’ve ever come across.

I’ll probably be reviewing it at some point as I think it’s that good!

Anyways, the one thing GeneratePress doesn’t show is breadcrumbs, in particular, Yoast SEO ones.

So how do you add Yoast SEO breadcrumbs to the GeneratePress theme?

1. First, head to the back end of your website to > appearance > elements.

Add a new element
Add a new element

Once you’re in the Elements section, click add new.

2. From the Element, type choose a hook

Choosing hook from the Element next we’re going to hook into the theme to display our breadcrumbs.

3. Give the Element a title, in this case, breadcrumbs (or whatever you like)

PHP Code for breadcrumbs
PHP Code for breadcrumbs

Once you have done that, we need to add some code to the box under the title, so for this, we need to use the above.

4. Once you’ve entered the code, we need to change the settings

Choose the hook location you’d like to display the breadcrumbs via the dropdown select box.

5. Lastly, still in the hook element we need to set the display rule

I don’t personally want breadcrumbs shown on my homepage; we can stop that from happening. I’ve chosen to show on single posts/pages and not on the homepage.

6. We’re done with the hook element next up we need to activate breadcrumbs.

OK so we’ve done the hard part (which wasn’t hard at all!) no we need to activate the breadcrumbs in the Yoast SEO plugin, really easy to do. So head on over to: Yoast SEO in the sidebar > Search Appearance > Breadcrumbs.

Breadcrumb settings for Yoast SEO
Breadcrumb settings for Yoast SEO

Simply save your settings, refresh a page on your blog and you are good to go!

That’s it that’s all there is to it. You now should have breadcrumbs on your site!

Please see below for code snippet used in the hook element. Please feel free to cut and paste.

<?php if ( function_exists('yoast_breadcrumb') ) { ?>
	<div class="grid-container grid-parent">
		<div class="page-header">
			<?php yoast_breadcrumb('<p id="breadcrumbs">','</p>'); ?>
	
		</div>
	</div>
<?php } ?>

That’s how you add breadcrumbs to the generatePress theme

No additional plugins are needed and no complex coding etc. Nice and simple, massive thanks to the people at GeneratePress for helping others by offering this code.

It’s for my reference hopefully useful to you as well

As I mentioned earlier, I’ve added this to another site I run in order to remind me how to do it when working with the GeneratePress theme in the future. I can refer back to it in case I forget how to do it. Hopefully, it will help you as well.

If you’d like more tips and tutorials, please stay tuned to my tips & tuts section here.

Want more tutorials on GeneratePress premium?

If you’d like to find out what else is possible with GeneratePress premium, I’ve got your back. Take a look through more tutorials to help you get the most out of GeneratePress.


Subscribe To My Newsletter 🚀

I hate spam; you do as well, come on, you know you hate it. I don’t spam. Simple. Join 48 others and sign up if you’d like to hear more from me.

By subscribing you agree to receive newsletters and agree with my Privacy Policy. You may unsubscribe at anytime.
Default image
Ben
Hey I'm Ben. LayerWP is where I spend most of my time. Creating content for WordPress beginners, reviewing themes/plugins, offering advice and tips and tutorials.

Leave a Reply