wordpress_add

Monday, 16 September 2013

How to get current URL at any page..??

This is the method to get URL of current page.Use and enjoy 

$link2=$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ;

$link_n2=explode('myvar',$link2);


echo $link_n2[1];




Subscribe Dr-Wordpress for Important Knowledge of word press..your's suggestions are most welcomed.


2 comments:

  1. Check out the global $wp object, too. It contains some useful information about the current query.

    ReplyDelete