Answers for "wordpress directory url"

PHP
3

home url wordpress

$url = home_url();
echo $url; // Output: http://www.example.com

$url = home_url( '/' );
echo $url; // Output: http://www.example.com/

$url = home_url( $path = '/', $scheme = 'https' );
echo $url; // Output: https://www.example.com/

$url = home_url( $path = 'example', $scheme = 'relative' );
echo $url; // Output: /example
Posted by: Guest on February-08-2021
0

includes folder dir url wordpress

You sad you put the json in wp-includes, but in the url you wrote wp-content. 
So I give you the code for getting the server path for both folders:

// wp-includes
$file = ABSPATH . WPINC . '/json/users.json';

// wp-content
$file = WP_CONTENT_DIR . '/json/users.json';

You can find many WordPress constants (like ABSPATH, WPINCand WP_CONTENT_DIR on
http://wpengineer.com/2382/wordpress-constants-overview/
Posted by: Guest on November-22-2021

Browse Popular Code Answers by Language