- This topic has 7 replies, 3 voices, and was last updated 3 years, 9 months ago by
David.
-
AuthorPosts
-
February 27, 2020 at 3:05 pm #1179162
Tijn
For some reason the blogposts give php error.
I debugged it with deactivating plugins and changing themes. When I deactivate GP Premium plugin. Problem is fixed. But styling is than not correct anymore.
February 27, 2020 at 3:13 pm #1179164Leo
StaffCustomer SupportHi there,
I don’t believe this would be a GP Premium issue.
Have you added any header or hooks elements?
https://docs.generatepress.com/article/header-element-overview/
https://docs.generatepress.com/article/hooks-element-overview/If so what happens if you disable them?
Let me know π
February 27, 2020 at 10:59 pm #1179343Tijn
Hi Leo,
Thanks! Thats correct. It has to do with the Custom Post Header it seems. But I haven’t edited it myself. Is there a way to fix this, or could you see what’s wrong with the code?
<?php
$img_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘large’, false );
$categories = get_the_category();
if ( ! empty( $categories ) ) {
$cat_name = esc_html( $categories[0]->name );
}
global $post?>
<h1><?php echo get_the_title($post->ID);?></h1>
<?php echo ‘term_id ) ) . ‘”>’ . esc_html( $categories[0]->name ) . ‘‘; ?><?php echo ‘‘; ?>
February 28, 2020 at 5:12 am #1179502David
StaffCustomer SupportHi there,
so this is the reason that script is not firing:
https://docs.generatepress.com/article/disallow-php-execution/
Which may be your default wp-config or something a security plugin has added.
If you want you can overcome this to allow PHP to be executed in GP Hooks only using the snippet provided here:
https://docs.generatepress.com/article/generate_hooks_execute_php/
February 29, 2020 at 2:19 am #1180337Tijn
Hi David,
Thanks for this. Learned a lot again. It’s indeed correct that the define( ‘DISALLOW_FILE_EDIT’, true ); was activated by the security plugin iThemes. I deleted this constant and after re-updating the Element it works again. But without the security measurement. The snippet doesn’t seems to work together with the disallow file edit.
– I added the snippet using the Cope Snippits plugin, no changes
– I added the snippet in wp-config.php -> blank pageCould you maybe suggest some other solutions?
For now it works again. Thanks!
Best, Tijn
February 29, 2020 at 6:29 am #1180445David
StaffCustomer SupportSo if you re-enable the iThemes security constant ( so the element breaks )
And add this to Code Snippets:
https://docs.generatepress.com/article/generate_hooks_execute_php/Does it still not work ?
February 29, 2020 at 6:48 am #1180533Tijn
Yes it works now.
But I first had to add the Cope Snippet and activate it before re-enabling the iThemes security plugin + constant. Otherwise it doesn’t got it.
Thanks for all the help!
February 29, 2020 at 6:50 am #1180640David
StaffCustomer SupportAah right – i suppose thats good security π Thanks for letting us know.
-
AuthorPosts
- You must be logged in to reply to this topic.