Enable Yoast Breadcrumbs in GeneratePress

  •  
  •  
  •  
  • 3
  •  
    3
    Shares

Last updated on December 12th, 2017 at 05:51 pm

Generate Press is an excellent free theme to start any WordPress project and the free Yoast SEO plugin gives you the possibility to add useful breadcrumbs. In this short tutorial we will show you how to implement the breadcrumbs from Yoast SEO in Generate Press Premium.

For the purpose of this tutorial we are using Generate Press Premium, which comes with the feature called GP Hooks.

You should have the following things already installed on your website:

  • GeneratePress free theme (the main or a child theme as currently active theme on your website, highly recommended that you use a child theme though)
  • GeneratePress Premium plugin
  • Yoast SEO free plugin

Checking the basic installations needed

1. Check if GP Hooks for Generate Press is activated

Go to Appearance. GP Hooks should be visible in the submenu.

gp hooks generate press

How to activate it if it is not?

Go to Appearance >> GeneratePress. Activate Hooks from the features list.

gp-hooks-active

2. Check if Yoast Breadcrumbs are enabled

Go to Yoast SEO >> Advanced. See the picture below. Enable them in case they are not.

yoast-breadcrumbs-enable

Implementing the breadcrumbs code

Go to Appearance >> GP Hooks.
Scroll down to Inside Content Container block and paste the following code there.

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

Remember to check Enable PHP  as well. It looks like this:

inside-content-container-yoast-breadcrumbs-paste-generateprees

Here is an example of the front-end, when the code is executed.

yoast-breadcrumbs-generate-press

Troubleshooting: problem implementing the breadcrumbs

If you have problems with some of the steps above or you got stuck trying to do it by yourslef, then the following tips might help you.

1. I see funny signs instead of the breadcrumbs on my website

breadcrumbs-generate-press-funny-signs

This means you forgot to check Execute PHP . Look here where to find this.

2. I don’t see Execute PHP checkbox at all in the back-end

This means that PHP code execution was disabled for GeneratePress. It is a good practice for some security reasons, when you want to lift up your WordPress website security level at 200%. But it also means you loose some quite good functionality.

Disabling PHP execution was achieved by adding a little piece of code in your wp-config.php. To enable it simply remove the following code from wp-config.php.

define( 'GENERATE_HOOKS_DISALLOW_PHP', true );

Do not forget to clean your website cache (in case you are using a cache plugin) and reload the page to see the change in the back-end.

wp-config.php can be accessed by connecting to your website via an FTP client like Filezilla or Cyberduck (only for Mac).


  •  
  •  
  •  
  • 3
  •  
    3
    Shares

Leave a Comment