I am currently using this function to remove the first image from my posts, however, I need to remove the first image from posts with a specific category. Any help is much appreciated.
function remove_first_image ($content) {
if (!is_page() && !is_feed() && !is_feed() && !is_home()) {
$content = preg_replace("/<img[^>]+>/i", "", $content, 1);
}
return $content;
}
//add_filter('the_content', 'remove_first_image');
I figured it out.
You can use in_category conditional functions