How to remove image, keep formatting with get_the_content
-
Hello,
I’m wondering, how can I remove images before the “more” tag with get_the_content, but preserve formatting? This is what I’m using currently:
<?php echo preg_replace("/\< *[img][^\>]*[.]*\>/i","",get_the_content('Continue reading <span class="meta-nav">→</span>'),1); ?>
This successfully gets rid of the image before the “more” tag, but removes all formatting, which I would like to keep.
Cheers,
Cindy
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to remove image, keep formatting with get_the_content’ is closed to new replies.