[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?

Dave Mee davemee at gmail.com
Wed Oct 7 11:15:45 UTC 2009


William, you're absolutely right. You star.

I attached your cigar to this post, hope it doesn't get scraped by the
mailman.

Dave

> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-
> bounces at lists.automattic.com] On Behalf Of William Canino
> Sent: 07 October 2009 11:47
> To: wp-hackers at lists.automattic.com
> Subject: Re: [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?
> 
> 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
> >
> _______________________________________________
> 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