What I would like to achieve is getting the posts categories and subcategories (without needing subcategories to be related to this post) (when viewing the post) in a list outside of the loop, preferably in a sidebar widget. I want it to get updated automatically when displaying different posts without needing the user to specify the categories or posts manually from back-end. I tried with GLOBALS but couldn't get it to work.
Anyone done anything like this before? How should I approach?
Thanks in advance.