Remove first image permanently
-
How i may permanently remove first image from posts ?
I know at least two ways to disable them, for example this onefunction 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');
and another one with css
display:noneBut i want to permanently delete first images with Mysql query, because hiding images as described above continue braking website markup. If i manually delete image from post, then markup displayed normally.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove first image permanently’ is closed to new replies.