Home  »  Learning guides  »  Dynamic tags  »  Url

Url

The Url tag gets various URLs for links.

Example

<Url plugins />

URLs

  • current - URL of the current page
  • site - Site root
  • home - Home
  • admin - URL of wp-admin
  • theme - Theme
  • child_theme - Child theme
  • content - URL of wp-content
  • plugins - Plugins folder
  • uploads - 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 - Login
  • logout - Logout
  • register - User registration

Multisite

  • network_site - Network site root
  • network_home - Network home
  • network_admin - Network admin

URL Query

The "query", in this context, means the part of a URL that comes after ? (question mark).

For example, let's take this URL: https://example.com?color=blue&size=small

The full query string is color=blue&size=small.

Each query parameter has name, = (equal sign), and value. They are joined with & (ampersand).

Use the query attribute to get a parameter by name:

<Url query=color />

In this example, the value is blue.

Examples