Hello. There is a while that outputs news with a summary. Inside this cycle, a foreach cycle is put in, which checks to which category the news belongs and, based on this, assigns a picture to the post. Problem: if a post has 2 categories, then 2 pictures are displayed, which is not necessary. How to set the condition correctly so that the category with the required id is not taken into account? I hope clearly stated. Code:
foreach((get_the_category()) as $category) { echo '<img src="http://сайт.ru/catimg/' . $category->cat_ID . '.png" alt="' . $category->cat_name . '" />'; }