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
Solution
<?php 
if( ! in_category(2) ) {
the_post_thumbnail_url();
}
?>

Find more questions by tags WordPress