Get default permalink structure from pretty URL’s
When a single post is clicked on from a category page or for that matter any page, you can get the URL of that referrer and parse it to get the query string. But this only works with the default permalink structure