Custom home template returns wrong get_the_category
-
I have a custom home template with no explicit query anywhere on the page. I do have a query on the sidebar, but directly on home.php.
When I go to the homepage however, WP is returning categories in get_the_category(). I would not have expected there to be any categories since there are no queries on the page.
This results in my header (custom) being rendered improperly and the wrong side bar is being selected. I have custom is_xxxxx() functions that depend on get_the_category() returning expected results.
Any idea what could result in categories being returned in get_the_category on a home.php page that has no queries or how I can explicitly clear these results at the top of home.php.
Thanks,
Phil
- The topic ‘Custom home template returns wrong get_the_category’ is closed to new replies.