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