Answers for "how to change wordpress home page url"

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
1

update url wordpress

<?php
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
Posted by: Guest on December-22-2020

Code answers related to "how to change wordpress home page url"

Browse Popular Code Answers by Language