Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get current page URL in WordPress
<?php
global $wp;
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo $current_url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment