No archive determination when no posts available
-
I’ve done some research about the following.
When posts are queried and the result of it is 0 (zero) posts, the method ‘is_post_type_archive’ (in file: woosidebars/classes/class-woo-conditions.php) fails and sets an empty archive name.
This is because the WP-method ‘get_post_type’ returns false when no posts are found because it relies on the global $post which is not set when no results are found.
Thus a simple fix for it is:public function is_post_type_archive () { if ( is_post_type_archive() ) { $this->conditions[] = 'post-type-archive-' . (get_query_var('post_type') ?: get_post_type()); } }
Could you implement this please? Thanks!
- The topic ‘No archive determination when no posts available’ is closed to new replies.