<?php site_url( $path, $scheme ); ?>
Parameters
$path: (optional) Path to be appended to the site url.
$scheme: (optional) Context for the protocol for the url returned. Setting $scheme will override the default context. Allowed values are ‘http’, ‘https’, ‘login’, ‘login_post’, ‘admin’, or ‘relative’.
It simply overrides the default parameters in URL.
For example if you have a website URL like http://www.example.com (without https) and you want to add https URL on a specific link instead of http, then you use $scheme parameter.
Related Posts:
- How to set ipv6 address as siteurl?
- Changing www prefix in General Settings and Interior Links
- Get current url with parameters passed
- Override WordPress theme url
- How to Create a Staging Site / Changing URL
- get_template_directory_uri cached?
- WordPress site isn’t reachable after site & home URL modification
- wp_options siteurl and home hardcoded?
- Unable to load WordPress local site after changing WordPress Address (URL) and Site Address (URL)
- can’t access my site [closed]
- Dynamically update Site/WordPress Address
- Does WordPress Strip Away the WWW from a Web Address
- Why is a wordpress login session limited to one domain
- problem with guid, when i change the folder name
- I changed the url from the setting then login panel not working
- Querystring value being stripped from site_url()
- Unable to Update Post when Changing Site URL
- WordPress replaces “https://” with “//” for Site & WordPress-URL
- How to delete blog word from wordpress url?
- Updated Site URL but it is not reflecting the changes
- How to set a home page on a WordPress site?
- Changing siteurl breaks site
- How to add www to images?
- WordPress database nonsense error
- Keeping the URL but changing the site – How?
- change the URL title and tagline
- Is there a way to append a trailing slash to get_home_url() and get_permalink( get_option( ‘page_for_posts’ ) )?
- I changed the site address and wordpress address from localhost to my ip and it doesn’t work anymore
- What’s the difference between home_url() and site_url()
- When moving a WP site, why does wp-admin redirect to old site?
- What is difference between get_bloginfo(‘url’) and get_site_url()?
- Switch from https back to http
- Ban SiteNames Multisite
- Wrong canonical link on wp-admin pages
- How to remove /index.php/ from URL’s
- How to remove “http://” When Echoing URL?
- Dynamic URL to reference custom PHP files
- How to inject custom url path for page ?
- Changing Site Address (URL) causes 404
- Login to wp-admin “redirect_to” points to wrong URL after migration
- Remove HTTP: from the site URL and just keep // in it
- Change homepage url
- Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past
- How to get rid of index.php?
- URL rewriting for WordPress Network (Multisite) subsite
- redirect 301 old url to new url
- Why does WordPress rely on an fully qualified site_url with a 15-step plan for moving a site?
- What is the purpose of storing `siteurl` in database?
- Customize multisite site creation with user data
- Changing my site url from azure.net to custom domain
- Images not working using Featured post
- How to retrieve TLD domain for the current website?
- Wrong wp-admin URL
- Adding subdomain to home_url for “add_menu_page”
- How to rewrite url wordpress?
- WordPress rewrite multisite blog url
- A URL that links specifically to the mobile version of my site?
- How can I remove the folder from a Multisite URL?
- Confusion about Site url and directory
- blog url redirecting
- Get the URL of the page from which an ajax request has been launched within ajax callback
- Changing the website URL to the root folder
- Changing the color scheme based on the url visited
- Publishing WordPress from stage to production server
- Redirect htaccess [closed]
- How to return site_url() without https://
- Showing my server ip in source code for several links not for all links
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Replace “http://localhost:8888/” by website URL in WordPress
- dynamic site link for future migration in echo do_shortcode()
- Page inside custom post type (url rewrite?)
- Cannot access WordPress website from external IP while internally it is working properly [closed]
- Proper way to have multiple installs with a single database
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Preventing Canonical Redirect for CDN
- Abnormal activity at url /my-account/add-payment-method/
- How to make a seo friendly URL of 2 different pages with same words
- How to access wordpress from domainB which is installed at domainA
- Colon is Missing In My Website Url in WordPress Shortcode
- WordPress is adding “category” word before my actual category name in url (and this is unsolicited)
- Is bloginfo(‘template_directory’) generated based on WP_SITEURL and WP_HOME in the settings?
- WP returns to domain root instead of siteurl
- SSL not working fine, Home url not matching with site url wordpress errors
- Why my URL has an unknown character string?
- Plesk login inaccessible after changing site URL
- There is how to change url domain on some posts?
- How to properly give WordPress its own directory
- My permalinks for all pages and posts now include old page titles as parents/categories
- WordPress switch domains
- Remove index.php from URL (WP installed in subdirectory)
- Homepage cannot be found
- All styles are looking for the site URL twice
- Unable to get WordPress’s apply_filters(‘site_url’) to return a https scheme
- Blog broken after changing Site/Home URL
- Moving Site: Is Re-downloading Files After Changing URLs necessary?
- Two domain site: Link base URLs point to wrong domain
- How to retrive previous Domain URL in Wp
- Giving WordPress it’s own directory and using .htaccess Directory Index
- How to change the default location where new post gets stored?
- Redirect all URLs in WordPress and Permalink to by country to subdomain