How to Get Wp-Content Folder in Wordpress?
If My Main. Php File Is Located Inside /Wp-Content/Plugins/Myplugin/Folder/Folder/Folder/ Why Including Urls. Php, Located Inside /Wp-Content/Uploads/Folder/...
if my main.php file is located inside /wp-content/plugins/myplugin/folder/folder/folder/
why including urls.php , located inside /wp-content/uploads/folder/ doesn't work with this path:
include_once("../../../../../uploads/folder/urls.php");
it works only if placed inside same folder as main.php with path ('urls.php');
2 Answers
you can use content_url() it's located with wp-content folder.
Or for path
you can use WP_CONTENT_DIR it'll located to wp-content folder.
require_once(WP_CONTENT_DIR. 'uploads/folder/urls.php');
Check more info Documentation
It seems strange. Do you have any error message when you run your main.php? Try to check again, maybe a typo somewhere. Do you take help of Text editor auto-completion when calling urls.php?