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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -