- This topic has 10 replies, 2 voices, and was last updated 3 years, 6 months ago by
David.
-
AuthorPosts
-
January 16, 2023 at 5:20 am #2497340
Matt
I’m using a breadcrumb plugin and hook element to execute the following.
<?php
if(function_exists(‘bcn_display’))
{
bcn_display();
}?>I had this in my wp-config.pho file and it was preventing the above element from running.
(‘DISALLOW_FILE_EDIT’, ‘true’);
Is there a fix or a workaround for this?
January 16, 2023 at 5:48 am #2497375David
StaffCustomer SupportHi there,
a few options
1. set that filter to
falseand allow file editing from the admin screen.2. use the code snippet from the following doc to just enable PHP editing in GP Hooks:
https://docs.generatepress.com/article/generate_hooks_execute_php/
3. use a PHP function instead to add the breadcrumb:
https://docs.generatepress.com/article/adding-breadcrumbs/#using-functions
January 16, 2023 at 5:58 am #2497388Matt
Not understanding.
3. Hook element is what I’m using.
January 16, 2023 at 6:15 am #2497409David
StaffCustomer Support3. is the Using Functions method in that doc:
https://www.screencast.com/t/YgOf4Vj4fC1
You don’t use a GP Hook Element.
You would add the code using one of the methods provided here:https://docs.generatepress.com/article/adding-php/
TLDR: Are you using a Child Theme?
If Yes, then that code goes in your Child Theme functions.php
If No, then install the Code Snippets plugin ( link in the doc above ) and add the code to a new snippet.This method also applies to option 2
January 16, 2023 at 6:27 am #2497420Matt
It is not a child theme.
If I use the code snippet plugin how do I exclude certain posts? With the hook element, I can choose to display only on posts and exclude certain posts.
January 16, 2023 at 6:40 am #2497430David
StaffCustomer SupportDo you use the Block Editor ?
If Yes, you can create a Block Element instead, and add the Yoast Breadcrumb Block.
January 16, 2023 at 6:46 am #2497439Matt
Appearance -> Elements -> is how I created it.
Again… MY issue is I had to comment out the line below in my wp-config.php for the element to work.
(‘DISALLOW_FILE_EDIT’, ‘true’);
January 16, 2023 at 6:56 am #2497453Matt
Also I’m using the Breadcrumb NavXT plugin not yoast.
January 16, 2023 at 7:04 am #2497459David
StaffCustomer Support1. Add new Code Snippet
1.1 Add this code to your snippet:add_filter( 'generate_hooks_execute_php', '__return_true' );1.2 Save the Snippet.
2. Then create your GP Hook Element. You will now be able to Check Execute PHP.
January 16, 2023 at 7:44 am #2497495Matt
Thanks. That worked.
January 16, 2023 at 7:55 am #2497652David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.