Add this into your functions.php file. This is untested, but should work 🙂
add_filter( 'the_content', 'italicize_latin_names' );
function italicize_latin_names( $content ) {
// Split up the content into an array of single words
$words = explode( ' ', $content );
// Loop through each of those words
foreach( $words as $key => $value ){
// If a word equals 'R.', add an <i> before it, and a </i> after the following word
if($words[$key] == 'R.' ){
$words[$key] = '<i>' + $pieces[$key];
$words[$key+1] = $words[$key+1] + '</i>';
}
}
// Put all of the pieces back together
return implode( '', $words );
}
Related Posts:
- Regex to Remove File Extension
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Adding regex filter to feedwordpress
- Grab WordPress Salt Data From URL
- Dynamic URL Rewrite for Custom
- Replace Dash (-) and Underscore ( _ ) with Space
- Apostrophes replaced by '
- Redesigning Custom Post Type “Add New” page
- WooCommerce store with ~30,000 products [closed]
- Is there any record of installed plugins in the database?
- Being notified when some YouTube video in some post becomes unavailable
- Custom headers for the WordPress plugin directory
- Is it possible to run plugin code when a multisite blog is deleted?
- plugin wants to update to wrong plugin
- Trying to avoid including wp-load.php
- Stackoverflow type of badge plugin giving warnings in WordPress 3.5
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- How to add terms to a post depending on its title?
- What Triggers a Plugin Update Alert
- Make the plugin directory recognize new version numbers
- Plugin.php: PHP Notice: Undefined offset: 0 in
- How to include admin-ajax when loading external javascript
- WooCommerce Dynamic Cart Pricing
- Remove action from a plugin class, forced to use global instance
- How to get last_updated and newest_blogs in WP 3.0
- WP Mail SMTP: What do the SSL/TLS options mean? [closed]
- How to create popup same as wordpress popup feature
- Moving WordPress from host without FTP?
- custom plugin – custom post type -Selectable options for User
- How to make first_name and last_name required fields in user profile?
- Security issues with WP sites
- Network: retrieve a list of latest posts
- How to add page using HTML, CSS and JS?
- Can we use a webservice with WordPress?
- WooCommerce get_price returning wrong price when used via ajax
- How I can get custom field’s current value?
- Using custom JS plugins with WordPress?
- How to resize images due to container width automatically server side/without CSS
- Checking instances of scripts in wp_head
- How to access data in wordpress database externally using php
- Add javascript to wp_head with call to plugin options?
- Anonymous Postings
- Using a function to change favorites listing
- how to add a button next to the wordpress view button?
- How can I prevent my plugin go development trunk [closed]
- (FES EDD) New vendor submission page is blank
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- After plugin activation all users marked as Spam
- Best place for if/else piece of code related to custom plugin?
- Banner not visible after plugin publishing
- WordPress 4.8.1 php getting commented
- Plugin usage wordpress
- Optimizing site
- Integrate Algolia to WordPress site
- Exclude posts from widget while post is showing on home, single and categories
- Is there any pre-existing plugin to track and block IPs with suspicious activity on my site?
- How to make custom plugin run on demand?
- Using WordPress to build membership Page
- Set WordPress Transient Expiration via Variable Value
- Override plugin class which has namespace
- How can I use my custom wordpress theme on two websites? [closed]
- How (or where) do I get wordpress plugin update download link?
- Plugin create pages and use templates
- Add custom PHP and HTML to the_content()
- Cannot read properties of undefined (reading ‘firstChild’) using photoswipe in product page
- Find Plugin by file name
- Creating an admin button that when clicked shows a popup form
- Add an action based on custom post meta field
- How to hide an option from dropdown in filter module
- $wpdb not working wordpress plugin ajax call
- how to create user profile pages and display them based on users roles
- Securing a plugin pop-up window
- Woocommerce – Change variations output
- how do i fixe Page Builder on a custom page?
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- How do I add languages?
- wp_enqueue_scrpts seems not to get called
- Which Membership Plugin? [closed]
- Adding featured image to post display widget
- How to Create Custom Dashboard for my Laundry Website?
- Warning: Illegal offset type in /var/www/html/wp-includes/option.php on line 1924
- How to create a WordPress sandbox on a live server for website development?
- What is a good way to test that plugin upgrades have completed properly?
- Moving sidebar links to below the header menu
- get post excerpt by query
- Advanced Custom Fields (ACF) Plugin – Random Image in Sidebar
- Deleted plugins displays error message
- How to delete remain data in WP database after deleting custom post via admin interface
- __FILE__ in WordPress plugins
- Looking for a related post plugin which slides-in like the one at inc.com does [closed]
- Populate Woocommerce order notes with custom field value
- cmb2 select option output [closed]
- Woocommerce Product Add-ons – Auto-select first option
- Sync roles across several plugins
- Jquery post responses 500 error after some time and lastly an 503 error
- Identifying Plugins Based on Tables [closed]
- Filter custom post type returned from REST api
- WP Elementor Pro causing crtical failure on website
- Render CMB2 select option to post page [closed]
- Footer option is missing in Customiser