Single.php – Get Current Parent Category
The very broad answer for why this doesn’t work is that the internet is stateless. Basically each request for a page is a separate and unique instance from other page requests. Example Let’s say post-1 is in category-1 and category-2. When WordPress loads post-1 on single.php it has no way of knowing how the user … Read more