Archived topic
Backend error showing frontend error message, creating big blank space
9 replies · Started by Catharina on March 5, 2022
Hi community,
I have been having this error showing on my front page between the menue and the page text. There is a big blank space, and when you highlight it, you can see the error. The error does not show, once logged in.
This is the error message.
Notice: Undefined index: login_req in /kunden/522883_44801/webseiten/wordpress/wordpress/wordpress/wp-content/plugins/gp-premium/hooks/functions/hooks.php(22) : eval()'d code on line 10
You can see the blue blank space on my website right here: http://www.jobforum-kultur.eu
What can I do to get rid of it?
Thanks everyone.
Hi there,
Looks like something you've added in GP Hooks is causing the issue.
Can you take a look at what was added in there?
The only thing that was added was the search function in the blog page. That was apparently it.
Anything I should change here?
<?php if (is_home() || is_search()): ?>
get_search_form();
?>
<?php endif; ?>
<?php if (is_front_page() && !is_user_logged_in()): ?>
<?php if (htmlspecialchars($_GET["login_req"]) == 1): ?>
<?php endif; ?>
<?php endif; ?>
I just deleted that part of code and when I want to put it back in, the search function does not reappear. Any way I can add a search function above the blog now?
Are you trying to add a search field below the header?
If so using a block element hook with the search block should help:
https://docs.generatepress.com/article/block-element-hook/
\https://wordpress.org/support/article/search-block/
The "bad" hook was a search function above the blog. Id need it back in that place, below the menue and above the content.
Here: https://jobforum-kultur.eu/job/
I havent been using blocks, no. So I dont know how to regain the now lost function.
You can create a hook element:
https://docs.generatepress.com/article/hooks-element-overview/
And this would output the search form:
<?php get_search_form(); ?>
The after_header hook should work.
It almost worked, except it ended up in the left sidebar and was also a bit squeezed/close to menu, so would need a bit more space before and after. Other than that, it should be the solution.
Thank you very much for taking all this time.
Just to make sure, we are all good here?
Let me know :)