How to check if the post exists in any of the categories?

Since you are doing this for a custom taxonomy (solution_cats), then you should instead use has_term() and not in_category() which works only with the default/core category taxonomy. So try this with your second code:

  • has_term( $category->slug, $category->taxonomy, get_the_ID() )

is_object_in_term() can also be used, but your syntax was not correct – the 2nd parameter is actually the term’s taxonomy and not the term ID/name/slug (which should instead be the 3rd parameter).

  • The correct syntax: is_object_in_term(get_the_ID(),$value->taxonomy,$value->term_id)
  • But you used this: is_object_in_term(get_the_ID(),$value->term_id)

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino