Created
June 28, 2021 11:21
-
-
Save hyperframed/c379cbce5f6c81bcb411279ae75a1295 to your computer and use it in GitHub Desktop.
Hivepress check if Listing is in Category
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( $listing->get_categories__id() ) : | |
foreach ( $listing->get_categories() as $category ) : | |
$cats = array( 91, 92, 93, 94, 95 ); | |
$catarray = $category->get_id(); | |
if ( in_array( $catarray, $cats ) ) : | |
echo "Categorie ist Suche"; | |
else: | |
echo "nope!"; | |
endif; | |
endforeach; | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment