Share

This function simply returns the URL of the current page.

The URL is returned with its protocol and TCP port number. I’ve added a shortcode just incase you need to return it within your page or post content.

The Code

Usage

  • In php code:  <?php if (function_exists(‘get_current_page_url’)) echo get_current_page_url(); ?>
  • Shortcode in post or pages:  [geturl]

Share