Url
The Url
tag gets various URLs for links.
Example
<Url plugins />
URLs
current
- URL of the current pagesite
- Site roothome
- Homeadmin
- URL ofwp-admin
theme
- Themechild_theme
- Child themecontent
- URL ofwp-content
plugins
- Plugins folderuploads
- Uploads folder
Login, logout, register
These URLs redirect to the site home page by default.
Pass a parameter redirect
to set the redirect URL.
login
- Loginlogout
- Logoutregister
- User registration
Multisite
network_site
- Network site rootnetwork_home
- Network homenetwork_admin
- Network admin
URL Query
The "query", in this context, means the part of a URL that comes after ?
(question mark). Each query parameter has a name, =
(equal sign), and value. They are joined with &
(ampersand). For example, let's take this URL: https://example.com?color=blue&size=small
Use the query
attribute to get a parameter value by referencing its name. The example below would output the value blue
:
<Url query=color />
Use the attribute without specifying a value to return the full query string in the current URL. The example below would output the value color=blue&size=small
:
To return the current URL including all query parameters, set the attribute equal to true
. The example below would output the value https://example.com?color=blue&size=small
<Url query=true />