Getting the Current URL in WordPress

For some reason, I could not find this anywhere in my searches.  You can get the permalink for the current post or page using:

get_permalink( $post->ID );

Of course this only works on posts or pages, not on searches and the like.  I have no idea why I had such a hard time finding this.

Leave a Reply

Your email address will not be published. Required fields are marked *