Getting URL of archive (category) page

Question

I’m trying to retrieve the current URL of the page, which works everywhere except for archive pages, for example, a category page. On a category page, it shows as the most recent post in that category.

$this_id = $wp_the_query->get_queried_object_id();
$this_url = get_permalink($this_id);
echo $this_url; // Should show like: http://domain.com/blog/category

How do I retrieve the actual archive page URL?

0
, John Robinson 7 years 2014-07-27T18:59:47-05:00 0 Answers 80 views 0

Leave an answer

Browse
Browse