Answers for "define and use site url globally wordpress"

PHP
2

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

change site url wordpress database

options table
1. siteurl
2. home

######## OR ########

// Add to top of wp-config.php
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
Posted by: Guest on December-18-2020

Code answers related to "define and use site url globally wordpress"

Browse Popular Code Answers by Language