replacing content text in the post
-
Hi.
I want to do something like this:function replace_content($content) { $content = str_replace('#TEXT A#', '<div>#TEXT A#<span>#TEXT A-1#</span></div>',$content); return $content; } add_filter('the_content','replace_content');
the code worked fine but I want to replace multiple texts in all posts so it would be very efficient for me to write and manage it something like this:
$text001 = ‘#TEXT A’ , ‘ #TEXT A-1’ ;
$text002 = ‘#TEXT B’ , ‘ #TEXT B-1’ ;
$text002 = ‘#TEXT C’ , ‘ #TEXT C-1’ ;Please help me genius people! ??
thanks.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘replacing content text in the post’ is closed to new replies.