I'm presently focusing on a wordpress plugin for Wordpress including plenty of .php files. I observe that for my AddShift.php file, we're effectively posting your blog header while using following type of code:
However, after i attempt to perform the same factor during my ajax_cal_split.php file, I recieve the next error:
Warning: include(./wp-blog-header.php) [function.include]: failed to open stream: No such file or directory in /opt/lampp/htdocs/sandboxj/blog/wp-content/plugins/Shifty/ajax_cal_split.php on line 11 Warning: include() [function.include]: Failed opening './wp-blog-header.php' for inclusion (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/sandboxj/blog/wp-content/plugins/Shifty/ajax_cal_split.php on line 11
Line 11 obviously states
Can there be any reason behind this call to operate on a single .php file and never another, once they live in exactly the same directory?
Yes - In my opinion wordpress works a burglar mechanism on content within the wordpress-content directory, I'd exactly the same trouble with styles. The workaround I made use of ended up being to include with absolute path names.
You should attempt while using Wordpress_Wordpress plugin_URL constant supplied by wordpress. For instance, you are able to define you actual wordpress plugin url such as this:
after which utilize it inside your calls like:
Thats the way i solve the issue, sorry for late answer however it may help the following ones checking in.
it really works, do as recommended and employ a complete url, i made use of