- This topic has 15 replies, 4 voices, and was last updated 3 years, 4 months ago by Elvin.
-
AuthorPosts
-
November 22, 2020 at 10:28 am #1541345ETO
Hello,
When I try to add breadcrumbs as explained here: https://docs.generatepress.com/article/adding-breadcrumbs/, the hook adds some odd codes into the theme instead of breadcrumbs.Have look at the screenshot to see the odd code, please.
November 22, 2020 at 11:12 am #1541391LeoStaffCustomer SupportHi there,
Did you check the Execute PHP checkbox?
November 22, 2020 at 12:19 pm #1541443ETOYes, I checked the Execute PHP checkbox, but there is still the same problem.
I tried both using shortcode and the php code of Yoast, but no change.
November 22, 2020 at 12:31 pm #1541455ElvinStaffCustomer SupportHi,
Can you provide screenshots of the code you’ve added so we could check for any syntax issues?
Alternatively, you can provide us temporary site access so we could check directly.
You can use the private information text field. Thank you. 🙂
November 23, 2020 at 12:44 pm #1543017ETOHi, Elvin!
I sent you temporary site access so that you could check directly.November 23, 2020 at 1:10 pm #1543041ElvinStaffCustomer SupportHi,
Your hook has this issue:
“Unable to execute PHP as DISALLOW_FILE_EDIT is defined.”Here’s an article on how to address this:
https://docs.generatepress.com/article/disallow-php-execution/November 23, 2020 at 11:30 pm #1543569ETOA few days ago, there was this code:
define( 'DISALLOW_FILE_EDIT', TRUE );
But, then, we changed it like this:define( 'DISALLOW_FILE_EDIT', FALSE );
So I don’t understand why you still got this error: “Unable to execute PHP as DISALLOW_FILE_EDIT is defined.”
A few minutes ago, we deleted this line of code from wp-config-php file completely:
define( 'DISALLOW_FILE_EDIT', FALSE );
So, could you please check the issue again?
November 24, 2020 at 2:33 am #1543797DavidStaffCustomer SupportHi there,
there may be other security settings on the server ( or in a plugin ) that is disallowing PHP editing.
Instead of editing the config file, you can add the PHP snippet provided here, this will allow PHP execution just in the Hook element:
https://docs.generatepress.com/article/generate_hooks_execute_php/
November 24, 2020 at 2:54 am #1543827ETOThe problem is not with just adding breadcrumbs php code, the problem occurs when we add breadcrumbs shortcode or any other code as well.
November 24, 2020 at 3:17 am #1543853DavidStaffCustomer SupportThe only element i see that requires PHP enabling is: Breadcrumbs – currently the PHP option is not checked
November 24, 2020 at 5:17 am #1544037ETOThat element is not active as it adds odd code to my site. I sent you my login info so that you can make any necessary changes such checking the PHP option or not, add shortcode or the php code to see if it works or adds the odd code I mentioned before.
November 24, 2020 at 5:22 am #1544043DavidStaffCustomer SupportI enabled the Breadcrumb hook and set its Display Rule location to Posts > All Posts.
The breadcrumb is now displayed.November 24, 2020 at 12:28 pm #1545032ETOThank you, David. I added category as display location apart from post. But breadcrumbs appear above all titles of the post on the category page. Please, check the screenshot and link I sent you.
November 24, 2020 at 6:14 pm #1545337ElvinStaffCustomer SupportHi,
But breadcrumbs appear above all titles of the post on the category page. Please, check the screenshot and link I sent you.
This occurs because your Hook Element is hooked on
generate_before_entry_title
. The Hook element is being placed on all entry-title on the page, including the post entry-title.To address this, simply change the hook on the Breadcrumbs hook element.
Here’s a visual guide on all the hooks and where they appear:
https://docs.generatepress.com/article/hooks-visual-guide/Perhaps
generate_inside_container_hook
orgenerate_before_main_content
fits your preference.November 25, 2020 at 5:19 am #1546060ETOThank you, Elvin. It is OK now.
-
AuthorPosts
- You must be logged in to reply to this topic.