We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0d25707 + 84a20e3 commit 878cf4aCopy full SHA for 878cf4a
include/lcp-category.php
@@ -65,9 +65,13 @@ public function current_category($mode){
65
$category = get_category( get_query_var( 'cat' ) );
66
if( isset( $category->errors ) && $category->errors["invalid_term"][0] == __("Empty Term.") ){
67
global $post;
68
- // Since WP 4.9 global $post is nullified in text widgets
69
- // when is_singular() is false.
70
- if (is_singular()) {
+ /* Since WP 4.9 global $post is nullified in text widgets
+ * when is_singular() is false.
+ *
71
+ * Added in_the_loop check to make the shortcode work
72
+ * in posts listed in archives and home page (#358).
73
+ */
74
+ if ( is_singular() || in_the_loop() ) {
75
$categories = get_the_category($post->ID);
76
}
77
if ( !empty($categories) ){
0 commit comments