Google Custom Search
[resolved] Fatal error: Call to undefined function (3 posts)

  1. Treebeard
    Posted 3 years ago #

    On a multisite: I can't get the search form to work with anything except the popup. It works, except if you add a new user and they click on the Activation link, the page is broken and there is a Fatal error where the search form normally is.

    The code in my template:

    <?php display_search_box(DISPLAY_RESULTS_AS_POP_UP); ?>

    The fatal error on the Activation page, /wp-activate.php?key=92de40009d567510 (I removed the http)

    Fatal error: Call to undefined function display_search_box() in /home/...../public_html/wp-content/themes/mytheme-v3/header.php on line 53

    We really didn't want the popup but there was no way around it, the other codes didn't work at all, because the search form is in the header (which is repeated throughout the network).

    Hoping this is something that will be fixed soon? We are about to launch the site, but just waiting on a response. If it's not something that can be fixed soon, please let me know (sorry! no pressure LOL!) We have a huge 200 site network for a college, so they'll be adding hundreds of new users this way, and that fatal error is breaking the rest of the page (because the search is in the header) - so all you see is the logo and that fatal error.

    Also - when you click on the link, the new user is never activated.

    Thanks for your help ~


  2. edwinkwan
    Plugin Author

    Posted 3 years ago #

    Hi Malawaimama,

    The problem you have is a PHP problem. With your new users, who do not have the custom google seach plugin activated and therefor the function display_search_box does not exist.

    Can you try this instead

    if (function_exists('display_search_box')) {

    What the code above should be doing is to check if the function display_search_box exists before calling it.

    Of course the best solution is to use a widget in there so you don't need to hard code the function.

    Hope it works, please let me know how it goes and can you mark the topic as resolved if it fixes your problem.

    Kind Regards,


  3. Treebeard
    Posted 3 years ago #

    that works! thank you so much for your help :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Custom Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.