brambleiah Posted February 11, 2009 Share Posted February 11, 2009 Hello! So, I made a really dumb mistake. I am new to Wordpress and I have published pages on my site. I tried to get into the code of widgets.php, but stupidly, I worked on the original desktop file instead of the one on my server and I uploaded it which replaced it. I should of downloaded widgets.php from my server. I spaced out. So, now I get this error on my page: Fatal error: Call to undefined function: get_search_form() in /home/borrowde/public_html/iremembermovies/wp-includes/widgets.php on line 771 Here is line 771 (of widgets.php): /** * Display search widget. * * @since 2.2.0 * * @param array $args Widget arguments. */ function wp_widget_search($args) { extract($args); echo $before_widget; // Use current theme search form if it exists get_search_form(); echo $after_widget; } btw~ I was originally trying to just change the amount of "Recent Posts" my page shows by following this tutorial: here.. Which I'm sure would of worked great, but I was an idiot and I probably added a 'blank' file with no recent search widget options. My site: http://www.iremembermovies.com Please help!! Thank you! Link to comment https://forums.phpfreaks.com/topic/144826-wordpress-sidebar-error/ Share on other sites More sharing options...
The Little Guy Posted February 11, 2009 Share Posted February 11, 2009 get_search_form() MUST be a function above wp_widget_search() in either an included file, or in the same file. So.. Is it being included, or is it above the function wp_widget_search()? Link to comment https://forums.phpfreaks.com/topic/144826-wordpress-sidebar-error/#findComment-759990 Share on other sites More sharing options...
brambleiah Posted February 11, 2009 Author Share Posted February 11, 2009 I'm a little confused about your reply.. Which is MUCH appreciated! But, are you saying I need to move "get_search_form()" above "wp_widget_search"?? When it comes to php I know next to nothing... Link to comment https://forums.phpfreaks.com/topic/144826-wordpress-sidebar-error/#findComment-760056 Share on other sites More sharing options...
The Little Guy Posted February 11, 2009 Share Posted February 11, 2009 I'm a little confused about your reply.. Which is MUCH appreciated! But, are you saying I need to move "get_search_form()" above "wp_widget_search"?? When it comes to php I know next to nothing... Yup! Link to comment https://forums.phpfreaks.com/topic/144826-wordpress-sidebar-error/#findComment-760058 Share on other sites More sharing options...
brambleiah Posted February 11, 2009 Author Share Posted February 11, 2009 OK! Thanks! I'll try it out! Link to comment https://forums.phpfreaks.com/topic/144826-wordpress-sidebar-error/#findComment-760062 Share on other sites More sharing options...
brambleiah Posted February 11, 2009 Author Share Posted February 11, 2009 I must of done it wrong because I get a big fat error on my site.. Did I not move it right??-> /** * Display search widget. * * @since 2.2.0 * * @param array $args Widget arguments. */ get_search_form(); function wp_widget_search($args) { extract($args); echo $before_widget; // Use current theme search form if it exists echo $after_widget; } /** * Display archives widget. * * @since 2.2.0 * * @param array $args Widget arguments. Link to comment https://forums.phpfreaks.com/topic/144826-wordpress-sidebar-error/#findComment-760070 Share on other sites More sharing options...
brambleiah Posted March 6, 2009 Author Share Posted March 6, 2009 Can you please show me the exact code so I can fix this? I tried the above code and a few other variations, but have come up short. Your help is much appreciated! Link to comment https://forums.phpfreaks.com/topic/144826-wordpress-sidebar-error/#findComment-778430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.