[wp-hackers] When archive.php is pulled in the theme, how does it know what category it applies to before (or as) the loop starts?

William Canino william.canino at googlemail.com
Wed Oct 7 10:46:41 UTC 2009


single_cat_title() ?

W

2009/10/7 Dave Mee <davemee at gmail.com>:
> Hi List!
>
> I know it's possible to pull category names from the post in the loop on
> that page, but I need to find out what definitive category is being
> requested.
>
> For example - invoking site.com/category/cat-b will pull up an archive page.
> However, if the first post in that category is also a member of cat-a, my
> efforts to find a category name are thrown off kilter - the canonical
> category should be coming from the URL, rather than the individual posts.
>
> Is there some mechanism to look into the guts of wordpress or the query and
> discover which category it thinks it's dealing with?
>
> Dave
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list