You can use home_url()
, which will point to the Site URL regardless of reading settings and/or what page it is:
echo esc_url( home_url( "https://wordpress.stackexchange.com/" ) );
You can use home_url()
, which will point to the Site URL regardless of reading settings and/or what page it is:
echo esc_url( home_url( "https://wordpress.stackexchange.com/" ) );