Response to Yoast
Hello Priscilla,
Thanks for the quick response!
Please know I am not a programmer, coder, or developer. As such, I rely heavily on tutorials and support form experts such as yourself to develop our site. So, please keep this in mind when asking questions and providing solutions.
Clarification: If I remove the entire line “define(‘DISALLOW_FILE_EDIT’, false);” from the wp-config.php file in the public_html directory, using a hook element in GeneratePress Pro allows Yoast Breadcrumbs (YB)to function. I mistakenly stated that if I set it to “true” that YB would work. My apologies.
All of our plugins are up to date and there are no plugin conflicts. Thanks for sending How to Check for Plugin Conflicts Guide.
All of our plugins are up to date. The site is built primarily with GeneratePress Pro with GP’s child theme and GenerateBlocks. We are not using a page builder. It is a site that is in development, so it’s a fresh install of WordPress, and all the plugins have been installed within the past month and have been updated as soon as a new version is available.
We configured YB based on the information provided in these guides:
1. https://yoast.com/help/implement-wordpress-seo-breadcrumbs/
2. https://docs.generatepress.com/article/adding-breadcrumbs/
Steps:
1. Create a Hook Element in Generate Press
2. Set hook to: after_entry_title
3. Set display rules to: Entire site (Just to make sure it was displaying and will refine to select posts later)
4. Enabled the option Execute Short Codes
5. Pasted the code below in the field for code
6. Updated the hook element
7. Enabled Yoast Breadcrumbs
‘<?php
if ( function_exists(‘yoast_breadcrumb’) ) {
yoast_breadcrumb( ‘<p id=”breadcrumbs”>’,'</p>’ );
}
?>’
Notes: I noticed that when creating this hook element, that in the Execute PHP option, it showed: Unable to execute PHP as DISALLOW_FILE_EDIT is defined. I ignored this as I was using the short code option.
8. Went to a post to verify if working. Instead of breadcrumbs, this appeared on posts: ‘,’
‘ ); } ?>
In looking for a resolution, I found a support topic on GeneratePress in which the issue regarding DISALLOW_FILE_EDIT in the wp-config.php file is mentioned by. For a GP user, it was the cause of YBC not working
GP Support Topic: https://generatepress.com/forums/topic/install-yoast-breadcrumbs/
If set to “true” the Theme Editor in Appearance is not available. If set to false, it is available. In either case, YB did not work. So, out of curiosity, I removed the entire line of code – define( ‘DISALLOW_FILE_EDIT’, true );
– from the wp-config.php file, and Yoast Breadcrumbs works. This also makes the Execute PHP option hook element in GP available. By removing it, however, the Theme Editor is available in the dashboard and is a security vulnerability.
I also tried another way to implement YB as explained in the section “Using Functions” in this GP Article: https://docs.generatepress.com/article/adding-breadcrumbs/. (I trashed the GP hook element beforehand). This method works even with DISALLOW_FILE_EDIT’ in place (it looks like that rule is not applied to it).
After reading this, what are your recommendations in order to use the hook element?
Thank you very much for your time and have a good day!