Tag Info

New answers tagged


Try removing (image), like this: <?php $content = get_the_content(); $content = preg_replace("/<img[^>]+\>/i", " ", $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?>


Can't you pass limit number of replacements in str_replace? Like that $text = str_replace(array_keys($replace), $replace, $text, 1); EDIT: Sorry I was thinking about something else and missed this one. You can use preg_replace and set limit in it. Like this one. function wp_affiliate_links($text){ $replace = array( '/ nursery rhymes /' => ...

Top 50 recent answers are included