In your if statement just add more conditions like this.
function et_last_modified_date_blog( $the_date ) {
if ( 'post' === get_post_type() || 'movies' === get_post_type() || 'etc' === get_post_type()) {
$the_time = get_post_time( 'His' );
$the_modified = get_post_modified_time( 'His' );
$last_modified = sprintf( __( 'Last updated %s', 'Divi' ), esc_html( get_post_modified_time( 'M j, Y' ) ) );
$date = $the_modified !== $the_time ? $last_modified : get_post_time( 'M j, Y' );
return $date;
}
}
add_action( 'get_the_date', 'et_last_modified_date_blog' );
add_action( 'get_the_time', 'et_last_modified_date_blog' );
The “||” means OR. So the condition would read If post type equals post or movies or etc.
Related Posts:
- Remove option to allow trackbacks/pingbacks from post page options
- Display posts by month
- Creating bulk posts with Youtube videos
- Hide wordpress field if data is empty in post!
- Custom posts in different columns style
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Update if post with specific title exists
- Only display notification on single post
- Auto create description in post
- Add multiple HTML attributes to an Elementor button
- Disable Attachment Pages Completely
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- Inject post (from specific category) between posts in Loop
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Creating custom Woocommerce attribute taxonomies from a plugin
- Load post content into iframe
- wp_customize_image_control default value
- How to get year, month and hour in WordPress?
- Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?
- Overriding a theme redux file in child theme
- Widgets not showing in my custom theme
- Print number of post (in reverse)
- Count number of published posts by type
- How to display custom field on homepage
- Get taxonomy terms only of the WP_Query current posts
- “before delete post” action fire when the post is updated?
- Hide post if matches current month and year
- Random Default Avatar Function
- How Display Posts on category
- Change the site tagline (or similar) based on current page
- create a select input with menus created on a custom options page
- How to pick the default selected value in wordpress dropdown?
- Customize position of social icons in upme plugin [closed]
- remove post that has no content
- Media Upload , file name changed automatically
- Replace shortcode in substring
- How to show only subcategories in parent category not parent category?
- What exactly do this function declared into functions.php file of a WP theme?
- WP Insert Post and then go to post
- Copy taxonomy terms from one post to another programmatically
- Get latest post from all categories except one
- Parse error: syntax error, unexpected end of file
- customize wordpress database error page
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- Load Posts on Click via Ajax into a DIV
- Where is the PHP code generating an element?
- Ajax search shows all results when user empties input?
- List post by title length
- create front-end users post list by specific category
- Need help with pagination
- Error display post thumbnails for previous and next post
- form $_post action value gets truncated after it passes through two forms
- Editor capabilities – admin_init
- WP insert post Redirect after function has executed
- Wp Query : Order by distance lat,lon
- get value from get_post_meta then reuse it in another get_post_meta
- How can I add diffrent editable text fields?
- WordPress Post Block Element not properly parsed with the_content filter
- Build A Custom SQL Query for WordPress Search
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- How to Send Pingbacks for all Posts in WordPress?
- Featured image in menu wordpres
- Display articles with a different template in the home page | Solved |
- How can I check if a post with a particular slug or title exists?
- WordPress sorting posts by date and title using a dropdown
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Trying to get post ID outside loop on blog page
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Enqueue script only on child pages of custom post types
- Attach and retrive multiple pdf files to post or page
- Send POST request to Flask app from functions.php file
- Need help transforming echo to return for use with shortcode
- Noob question: want to remove the “site identity” logo for specific part of website only
- Get list of posts from attachment
- Redirect after login depending on the URL
- When working with a post, almost all wp_postmeta are deleted
- Displaying POST content with HTML tags and all
- Generate random access token to a post page
- Real time notification on user profile after new comment
- How to add text before posts
- Pagination in WP Queries
- Add two or multiple functions in WordPress Post or Page
- Add div after every 4 posts then every 2 posts for a responsive loop
- WordPress error on my website
- Can’t put a hyperlink on Featured Post’s Image
- WordPress get_post_meta issue
- Best way to define a database with product codes and back-end support?
- wp_customize_image_control default value
- Display pages from specific page template
- Widget header unique classes
- why is this content-template not showing any of my blog-entries?
- How to add button to top of theme customizer?
- How can I add more code to this?
- Edit the Publish Widget Options
- How to display the date under the post title?
- New to WordPress & Freelancing [closed]
- WooCommerce: write featured image dimensions to custom fields in product’
- transition_post_status hook, works – but not if the post is new