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
- woocommerce change currency per category [closed]
- Move Custom Fields on General Settings Page to New Location
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- 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
- Redirect to another page using contact form 7? [closed]
- append to existing parent theme function
- different style sheet for just one page template
- Override the WordPress core function wp_referer_field
- Modify post filter to set custom number of posts per page and exclude child posts
- Make wp_link_pages() suitable for Twitter Bootstrap markup
- How can I add a filter for specific categories on functions.php?
- How to add custom JavaScript in functions?
- Setting a default text for excerpts of a particular category
- How to edit the Tags within the image file URLs?
- Replace image attributes for lazyload plugin on image elements with specific class
- Adding A New Widget to WordPress Disables the Existing Widgets
- How To Show Shortcodes In WordPress Custom Fields?
- Help! Need a different logo on my main page from my other pages
- WordPress Add advertising ads befor and after content with periority [closed]
- Display page number on custom page title function
- Only seems to be displaying one child when there are supposed to be multiple
- Best way to add image to recent posts widget?
- How to replace words in my posts and saved new words
- Why might wptexturize have become re-enabled?
- How do I integrate my Child Theme into a Custom Template?
- previous_post_link inside of a function?
- Search and Replace Script Loader in Head Only Works in Footer
- Regex works in regexr, but not if I filter content [closed]
- Retrieve a custom form field modified by a filter
- functions.php filters not applied in AJAX call
- Add functionality to post editor
- custom post with loading script per single post
- Function the_content
- Problem in outputting shortcode
- Settings in functions.php used by a plugin
- How to Add A Rel Filter to All Links?
- Print all inline styles to head
- Allow tags and attributes in post and pages content
- Override parent theme function that is not hooked or in the functions.php file
- Get Value of Custom Field
- restrict access to specific urls on a specific period of time
- How to request login for user but not for bots
- functions.php / replacing div’s with new ones?
- How accomplish modification the_content if home/start page?
- Can’t change excerpt length and more tag
- Why does modifying my functions.php file always result in a server error
- Function Reference for custom link in Admin Menu Management Page
- Display a list of users with avatar filterable with alphabets
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- Post variables not displaying correctly in custom function
- Remove snippets of JS from core
- Filter to strip unnecessary attributes
- Trying to get this function to show below the content
- Removing Facebook contact field from user contact not working
- How do I add functionality to images?
- Explode Array from Repeatable Custom Field
- Creating mixture of shortcodes to use in the visual/text editor
- How I can show short content with short tag
- WordPress Custom wp mail template return full template
- How to Add Extra Text In WordPress Title Before Post Publish
- Problem with removing characters “<” – WpAllImport
- How to create a post without link in wordpress?
- How to crop image in WordPress with aspect ratio for any size of image
- multible shortcodes (for differnt values) with one function
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- function to show youtube videos within excerpt – if condition and apply_filters
- How can I modify or filter this variable in an existing class? (Mai Theme)
- post_row_actions filter from parent theme not executing in child theme
- Customizer cuistom CSS Priority ordre Issue
- Copy and Modified WooCommerce function is_coupon_valid [closed]
- BuddyPress Edit activity function good practice
- wp_login_form display no styled form
- Advanced Custom Fields in WP_Query: Clickable Text in List Format
- get last part of page url and add it as cat in wp_query
- Apply function only for specific post
- Overriding an existing filter
- disable a specefic sidebar when user is log out
- Add custom css to specific user
- How can I restrict comments on WordPress, so only the POST AUTHOR and the user who commented can see them?
- Remove Actions/Filters added via Anonymous Functions