Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress - PHP Fatal error: Call to undefined function get_bloginfo()

I'm integrating an external script with my wordpress theme and I'm getting this error in one of my files:

PHP Fatal error: Call to undefined function get_bloginfo()

this script is located in

themes/mytheme/myscript

And all files are included as following:

include(WP_CONTENT_DIR."/themes/mytheme/myscript/myfile.php");

how can I fix it?

like image 894
middlelady Avatar asked Dec 07 '22 21:12

middlelady


2 Answers

The issue is usually mysql related...you need to reset your wordpress db user password.
That is to say that the password for the database user for wordpress has expired and you don't know about it.
Either do a linux command-line

mysql -uroot -p
SET PASSWORD FOR <WPUSERNAME>@localhost = PASSWORD('whateveryouwant');

Or through phpmyadmin - users tab -> Edit privileges -> Change password

like image 159
Jadeye Avatar answered Dec 10 '22 12:12

Jadeye


you must include wp-blog-header.php in your main php like this

require WP_DIR.'/wp-blog-header.php';

being WP_DIR the main wp directory

like image 38
giorgiosaud Avatar answered Dec 10 '22 11:12

giorgiosaud