function replace_content($text) {
$replace = array(
'Check' => '<span style="color:red">Check</span>',
'Map' => '<span style="color:red">Map</span>',
'Comments' => '<span style="color:red">Comments</span>',
'Print' => '<span style="color:red">Print</span>'
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
add_filter('the_content','replace_content');
Related Posts:
- The_content and Preg_replace in loaded Iframe [closed]
- Shortcode to eliminate and replace with
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Default or Preset Content for Custom Post Types
- How would go about if I just want a temporary function?
- Adding HTML to the end of every post with the Block Editor
- Insert image in WordPress with HTML5 tag and caption function
- Add Element as a Filter to the_content
- login_headertitle is deprecated since version 5.2.0
- Insert Content Before div#main from the functions.php File
- Problem with images URL after filter applying
- Save_post – Warning: Cannot modify header information
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- $content is empty while using DOMDocument
- How to make an If Else on Excerpt Filter
- child_of not working while searching
- When should you, and when should you not, use wp_list_pluck()?
- Change admin bar to default:off
- Woocommerce add to simple product attribute programmatically [closed]
- Insert Ad Code in the Middle of a Post
- How to reduce original image quality on upload?
- Convert hyphen to underscore in permalinks
- Programmatically Add Font-Awesome Icons to Category Widget
- Change comments form title on a page by page basis
- Remove bulk actions based on user role or capabilities
- How to change a certain text or term of WordPress into a custom into the whole site?
- Adding body class when post contains a specific shortcode
- How to get Custom Post ID by adding filter to child theme’s function
- Theme-Config tab in admin Pannel?
- How to Add a Random Custom Gravatar in the WordPress Comments?
- Manipulate Output of wp_list_something: select menu instead of li’s
- Show excerpt for only first post in query
- How to mass-delete inline styles in WordPress custom post type automatically?
- PHP files included in functions.php don’t seem to work
- How Can I Expand the WordPress Customize window without any Plugin?
- Set quantity of woocommerce product on page visit [closed]
- Inserting a functions output after the content
- Add caption functionality to custom WordPress theme
- How do I add Bootstrap and LESS to my migrated WordPress site?
- How to add nav menu items to a specific position within a menu
- Passing values from a widget to a function within a plugin
- Removing permalink from post thumb in twentyeleven
- Publish/Update post is changing image links from file url to post url
- Best practices regarding the creation of custom widgets?
- Word Press – Dynamic Content [closed]
- Adding an external HTML link to a post thumbnail
- Replace a menu with widget or a custom template file programmatically
- woocommerce change currency per category [closed]
- Run wp_kses_decode_entities on atom feed?
- Filtering out the #more anchor link that gets produced by
- Can’t filter wp_get_attachment_link
- append to existing parent theme function
- different style sheet for just one page template
- How to add custom JavaScript in functions?
- How to add_filter html template to middle of content
- Redefine function arguments before rendering
- How do I pull excerpts from pages?
- does wp function the_content(); accept another tag inside
- Combine embed_oembed_html and oembed_result
- Filter to wp_list_authors
- Different favicon on different pages
- first paragraph of the_content as meta description
- Changing where my author box is printed
- Add Adsense code between job listings – wp job manager plugin
- Replace header image on all other pages but home – URL issue
- How to echo Widget Title in Custom Frontend-Template Box
- how to display a page before the home page
- loginout function customization
- implementing a centralized content “show-do-not-show” toggle?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- how can I add filter in specfic field in my website?
- How to remove font awesome from loading in wp theme
- Customizing the wp_video_shortcode output with add_filter
- How to add HTML into error message
- Removing comment lines from all enqueued js files using a filter function
- How to bind each “the_content” elements to a custom variables
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- function replace_text for entire page
- add product thumbnail to checkout page only and include variation name
- WordPress function with attribute pass to template
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Graphic before title – Specific Category
- Which method is more correct for removing WooCommerce Extensions menu item?
- Help! Need a different logo on my main page from my other pages
- Display page number on custom page title function
- How to replace words in my posts and saved new words
- Why might wptexturize have become re-enabled?
- functions.php filters not applied in AJAX call
- Add functionality to post editor
- Settings in functions.php used by a plugin
- Can’t change excerpt length and more tag
- Why does modifying my functions.php file always result in a server error
- Remove snippets of JS from core
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Advanced Custom Fields in WP_Query: Clickable Text in List Format
- Add custom css to specific user
- Remove Actions/Filters added via Anonymous Functions