Skip to content

Philip Wharton

Web Developer

Tag archives: WordPress 5.2.2

How to get the current page URL in WordPress

In most scenarios get_permalink() will cover your needs, however, that will only get you the current page URL for single posts, pages, and custom post types and only works within the loop. There is get_post_type_archive() for post type archive URLs and get_term_link() for category/taxonomy URLs but it would be nice if we had one all-encompassing […]

Posted byPhilip Wharton22nd August 201919th July 2020Posted inWordPressTags: WordPress 5.2.2
Philip Wharton, Proudly powered by WordPress. Privacy Policy