I have added custom PHP file in WordPress directory and added following line to use WordPress functions:
require ('../wp-blog-header.php');
Now I am able to use WordPress functions but unable call this file from javascript in ajax.
When I removed following line then I am able to call this file:
require ('../wp-blog-header.php');
Please suggest how can I solve this issue.
wp-admin,wp-contentorwp-includes? If so, this is not really safe, because your file could be deleted on Wordpress update. It should be either in your template, or maybe outside of wordpress directory if there is onewp-blog-header.phpfile.