[wp-trac] [WordPress Trac] #6741: in_category not working in WP 2.5
- ignores category id/name
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 16 00:34:16 GMT 2008
#6741: in_category not working in WP 2.5 - ignores category id/name
----------------------+-----------------------------------------------------
Reporter: TrishaM | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.7
Component: Template | Version: 2.5
Severity: normal | Keywords: in_category
----------------------+-----------------------------------------------------
Used the following code as suggested in the Codex for in_category,
however, in all cases regardless of the actual category ID that the post
has assigned to it, the second include-file is being served.
`<?php
$post = $wp_query->post;
if (in_category(16)) {
include(TEMPLATEPATH . '/single-cat-16.php');
}
else {
include(TEMPLATEPATH . '/singleproduct.php');
}
?>`
--
Ticket URL: <http://trac.wordpress.org/ticket/6741>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list