<img src="../wp-content/plugins/my_plugin/images/an_image.png" alt="picture" />
Because I’m expecting there to be a wp-content folder and a plugins folder, if I hard code these values could things go wrong?
I know if I do things with php I can use the dirname(plugin_basename(FILE))
function but what should I be doing? And why?
I’m new at this react and I can seen to get the value from the dirname(plugin_basename(FILE))
function to the html.
I’ve added a script to my WordPress and i’m including it in the functions.php, it’s as simple as:
require( get_home_path() . "/lib/server-type/server-type.php");
But i have a problem with your plugin if, i deactivate it, i get a Fatal Error:
Fatal error: Call to undefined function get_home_path() in /Applications/MAMP/htdocs/worona-web/wp-content/themes/worona-theme/functions.php on line 10
The WordPress function get_home_path() only works while your plugin is activated. I’ve tryed it deactivating all the other plugins i have…
I’ve coded a fix:
require( dirname(__FILE__) . "/../../.." . "/lib/server-type/server-type.php");
But i would like to understand how your plugin can cause this problems while it’s deactivated…
Hope you can help us,
Thanks to JSON API we’ve created worona.org
https://www.ads-software.com/plugins/json-rest-api/
]]>I changed from __DIR__ to dirname(__FILE__)… but … there is a lot more problems…
There is a chance, or … not?
Tnx a lot!
https://www.ads-software.com/plugins/woocommerce-skrill-moneybookers-gateway/
]]>I have made several attempts to install a new wordpress distribution on an account. We didn’t get farther than the first page until we added more memory allotment to php.
Now, there is a new problem- I can’t get past the admin login. I have cleared the database and site and reuploaded wordpress with forced ascii, and problem remains.
After filling out wp-config.php and entering the initial info for admin user, I get these php errors and nothing else when I log in-
Warning: require_once(./wp-load.php) [function.require-once]: failed to open stream: No such file or directory in ./admin.php on line 30
Fatal error: require_once() [function.require]: Failed opening required ‘./wp-load.php’ (include_path=’.:/usr/local/php5/lib/php’) in ./admin.php on line 30
Is there any advice you can give me?
Thanks tons for your help.
Ann Cantelow
(I apologize for asking this question yesterday on someone else’s thread before when I should have posted a new topic.)
]]>Thanks.
]]>Because I could not find any information about this on the internet, and I did not see anything about this on the forum, I am posting it here. I could not find a bug tracker or anywhere else for it.
Here is the line I changed in wp-config.php:
define('ABSPATH', dirname(__FILE__).'/');
and in my case, I had to change it to:
define('ABSPATH', 'w:/www/wordpress'.'/');