Site logo

Archived topic

"Posts" pages give php error

7 replies · Started by Tijn on February 27, 2020

Viewing posts 1–8 of 8

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.

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 ''; ?>

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 page

Could you maybe suggest some other solutions?

For now it works again. Thanks!

Best, Tijn

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!

Aah right - i suppose thats good security :) Thanks for letting us know.

This archived topic is closed to new replies.