WordPress Code Snippets

A fresh mix of code snippets and tutorials

PHP: Get current URL


Nice lil slab of PHP to get the current URL. Useful for a wide variety of applications, nice one to have in the tool belt.


echo get_current_URL();

Note: this returns the server name and other variables without any sanitization. It’s probably a good idea to sanitize the output just in case the server is sending bogus name and/or other infos.

Show Support

Like our new Facebook Page to show support!