Reply To: Fatal Error Upon Activation

#3343
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

Sure thing. It looks like your theme is declaring the same function used in the plugin, but it doesn’t check if it already exsists. The issue is not related to the search plugin per se, but I will help you anyways.

Based on the error messages if you open up the themes functions.php file and go to line 257, you will see something like this:


function current_page_url() {
   ...
   ...
}

The { and } brackets indicate the beginning and the end of the function. The ending } bracked should be a few lines below line 257. Now, the best solution is to wrap this piece of code into an if statement. This is the standard way to check wether the function is already declared. So you need to wrap the function code like this:


if (!function_exists("current_page_url")) {
   function current_page_url() {
      ...
      ...
   }
}

This will fix it immediately. Please also notice the theme developer to wrap all of the functions in his theme functions.php file in such way, because it may cause conflicts with other plugins as well.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)