The Server Dynamic Shortcode in WordPress allows users to retrieve specific server information efficiently.
Syntax
{server:variable}
variable
: The name of the server variable you wish to access, corresponding to the keys in the$_SERVER
PHP global array.
Examples
Accessing Server Name
{server:SERVER_NAME}
This retrieves the server's domain name.
Getting Server Software
{server:SERVER_SOFTWARE}
Displays the server software being used (e.g., Apache, Nginx)
Fetching Document Root
{server:DOCUMENT_ROOT}
Returns the document root directory under which the current script is executing.
Server Protocol
{server:SERVER_PROTOCOL}
Shows the name and revision of the information protocol (e.g., HTTP/1.1).
Remote Address
{server:REMOTE_ADDR}
Retrieves the IP address from which the user is viewing the current page
Special Privileges
The Server Dynamic Shortcode must be used within a Power Shortcode.