invalid argument fror each()
-
Please see the link below:
In the widgets area on the right side, I am getting the error:
Warning: Invalid argument supplied for foreach() in /home/content/04/9655804/html/wp-content/themes/parallelus-salutation/functions.php on line 271
The code in these lines are as follows:
function qa_widget_show_sub_cats( $cat_args, $instance ) { global $post; if ( is_qa_page() ) { $cats = get_the_terms( $post->ID, 'question_category' ); foreach ( $cats as $category ) { if ( $category->term_id ) { $termchildren = get_term_children( $category->term_id, 'question_category' ); if ( $termchildren && !empty( $termchildren ) && !is_object( $termchildren ) ) { $cat_args['child_of'] = $category->term_id; break; } } } } return $cat_args; }Could you please help me figure out where is the problem?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘invalid argument fror each()’ is closed to new replies.