How to remove the display images in wp?

displays the picture in content.php.
How to make sure that the picture is displayed in all categories except for category 2?
March 19th 20 at 09:16
1 answer
March 19th 20 at 09:18
if( ! in_category(2) ) {

Find more questions by tags WordPress