Category archive, but is_category is false
-
I’m not sure if this is a bug but there’s something weird going on here. I’ve been struggling to figure out why
single_cat_titleorwp_titlewon’t work inside anis_categoryquery inside a functions.php function, then I checked the contents of query variable and turns outis_categoryis null even if there’s a value for the category name and such.[comments] => [comment_count] => 0 [current_comment] => -1 [comment] => [found_posts] => 2 [max_num_pages] => 1 [max_num_comment_pages] => 0 [is_single] => [is_preview] => [is_page] => [is_archive] => [is_date] => [is_year] => [is_month] => [is_day] => [is_time] => [is_author] => [is_category] => [is_tag] => [is_tax] => [is_search] => [is_feed] => [is_comment_feed] => [is_trackback] => [is_home] => [is_404] => 1 [is_comments_popup] => [is_admin] => [is_attachment] => [is_singular] => [is_robots] => [is_posts_page] => [is_paged] => [query] => Array ( [category_name] => news [taxonomy] => category [term] => news )queried_objectis also null.Depending on the category archive I browse, sometimes
is_archiveis true (1), sometimes it isn’t. Sometimes thebody_classalso turns up a 404 error.What could be the possible cause for this? Plugins? Permalinks? All of the above?
The topic ‘Category archive, but is_category is false’ is closed to new replies.