php - Notice: Undefined property: WP_Error::$term_id -


hello facing problem .

notice: undefined property: wp_error::$term_id search.php on line 53

and here code.

if($category_name != "all") {         $thiscat = get_category(get_query_var('cat'),false);             if(isset($thiscat)){                 $catsearchid = $thiscat->term_id;             }      } else {         $catsearchid = '-1';     } 

any body please? thanks

notice: undefined property: wp_error::$term_id search.php on line 53

this error clear, term_id property not part of $thiscat.

for solution,

do not pass second parameter in get_query_var() function. optional parameter default empty.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

java - Log4j2 configuration not found when running standalone application builded by shade plugin -

python - How do I create a list index that loops through integers in another list -