Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/ 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');

like image 549
Nathan Bernard Avatar asked Oct 12 '19 14:10

Nathan Bernard


People also ask

Where is the WP-content folder in WordPress?

Typically you will see the wp-content folder somewhere in the right panel of the web page straight away. If you cannot see a folder in the panel called wp-content , you may be able to find it in a different location in the left panel, such as: / public_html , /home/your_account_name , or /wordpress .

How do I access wp-content themes folder?

You want to find the WordPress theme folder. This is the only folder that you should ever modify the contents of. To access the theme folder go to wp-content/themes/your-theme-name. This folder contains all of the files that make up your theme.

How do I access my WordPress folder?

Well, simply just go to your WordPress Dashboard. If you wish to make changes to your Theme, then navigate to wp-admin -> Appearance -> Editor. Afterward, you will be able to view the files inside your Theme.


Video Answer


2 Answers

you can use content_url() it's located with http://www.example.com/wp-content 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

like image 194
Dilip Hirapara Avatar answered Oct 29 '22 07:10

Dilip Hirapara


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?

like image 1
Abel LIFAEFI MBULA Avatar answered Oct 29 '22 07:10

Abel LIFAEFI MBULA