Archived topic
Author box doesn't work
7 replies · Started by Kiva on December 23, 2022
Hi
I've tried adding the Element and CSS code that I found on Wp Logout but the author box doesn't show up properly. I just get an empty box with 3 periods. Here's a screenshot of the code I had used: https://drive.google.com/file/d/1VDPVcklmt0palnT5gI_LncXEWS6UYgSB/view
Could that "unable to execute PHP" message be the issue? I've added other Elements before that worked yet had that same message so I don't know if it would be an issue.
Note that I am not using GenerateBlocks so the answers and videos I saw on the forum regarding using blocks don't work for me.
Hi there,
Your screenshot shows that there is PHP in the code:
https://www.screencast.com/t/sKyIaiUCASE
Therefore you would need to Execute PHP for the code to work.
See more info here:
https://docs.generatepress.com/article/disallow-php-execution/
I changed "true" to "false" in that line of code in the wpconfig but I still get the Unable to execute PHP as DISALLOW_FILE_EDIT is defined error. I've tried clearing caches, but it still shows up.
Is there something else I should do?
Alternatively, is there a way to get a bio box without having to allow file editing? I'd prefer an alternative way as I'd rather not allow file editing since it makes the site less secure. I'd rather not use a plugin just for this one thing.
Hi there,
you can visually build one using a GP Block element:
https://docs.generatepress.com/article/block-element-hook/
And theres a couple of videos on our YouTube channel showing you how to build an Author Box:
Static Content - If the site only has one author:
https://www.youtube.com/watch?v=HMhUo91RjsE&t=8s
Dynamic Content - If the site only has multiple authors:
https://www.youtube.com/watch?v=4x6CjGOyagc&t=17s
Thanks, but I should have mentioned that I don't use Generateblocks. I'm just looking to use Gutenberg.
Using GB is definitely the best solution.
If you are not using GB then a third-party author box specific plugin like this would be my recommendation:
https://wordpress.org/plugins/simple-author-box/
Unfortunately we cannot help with implementing a custom solution from another source.
OK, then I'll do it the basic way then. Can you refer to the first part of my reply:
I changed “true” to “false” in that line of code in the wpconfig but I still get the Unable to execute PHP as DISALLOW_FILE_EDIT is defined error. I’ve tried clearing caches, but it still shows up.
Is there something else I should do?
There could be a security plugin or built-in server security blocking it as well.
There are several suggestions in the documentation article I linked in the first replay including defining a constant:
define( 'GENERATE_HOOKS_DISALLOW_PHP', true );