Saturday, May 21, 2016

WordPress get current page url

To get the current active page URL in WordPress use the following function.

<?php
$current_page_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
?>


Now you can use $current_page_url any where you like as it contains the current page URL of the active page.

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...