Site logo

Archived topic

Unable to execute PHP as DISALLOW_FILE_EDIT is defined.

1 reply · Started by Roger on May 21, 2021

Viewing posts 1–2 of 2

Hi! I've been reading about this problem but I don't know how to solve it.
I can solve it including this code?
add_filter( 'generate_hooks_execute_php', '__return_true' ); (https://docs.generatepress.com/article/generate_hooks_execute_php/)
In which file of the pluguin should it be inserted?
gp-premium/hooks/generate-hooks.php
or
gp-premium/hooks/functions/functions.php

Thanks

Hi there,

golden rule is to never edit the Theme or Plugins files, as any changes will be lost when they are updated.

This doc explains how to add PHP to your site:

https://docs.generatepress.com/article/adding-php/

TLDR: If you have a Child Theme installed then add the code to the Child Themes functions.php file. If not, then install the Code Snippets plugin and create a new snippet and add your code.

This archived topic is closed to new replies.