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
- Random Default Avatar Function
- Remove posts after a given amount of time
- Automatically add custom CSS to new posts using a category template
- How Display Posts on category
- How can I use wp_query to show all product data using just the products ID?
- Change the site tagline (or similar) based on current page
- Query all posts of a custom taxonomy term
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Retrieving Author ID in wp-admin area
- Setting custom canonical urls
- Only show search results with if current date is between two dates?
- database interactions using OOP
- Customizer: Output default value in Customizer CSS
- How to add just one specific page to widget without plugin?
- Remove one value in dismissed_wp_pointers?
- create a select input with menus created on a custom options page
- Taxonomy linked to pages
- Getting a specific post values to another div or modal
- Trying to add attribute to my posts’ featured image
- Displaying the last post on static homepage
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Can’t get wp_insert_post to work
- Why not yield/iterable in posts interface?
- Accessing data from a non-WP database/table within a page content
- WordPress blog post url on category page
- Best practice for migration friendly images in posts/pages?
- Changing layout with wp_customise
- WP dynamic featured image – Can’t get second featured image url
- Converting HTML Template to WordPress Theme
- Extending the WP_Widget_Text class
- How to show part of the_content?
- WordPress Custom Fields (Checkboxes with multiple values)
- Selectbox in admin panel function linking to CSS
- How to make number of blog posts a custom field?
- Can I install/embed WordPress on a ‘single page’?
- Unreadable pagination
- 200 Rewrite blog post links
- How to set a min number of words for a blog post
- Loop through categories and display posts title under each dropdown
- Get post id in a function when edit/add a post
- How to check if a meta value has already been assigned to any user?
- How to hide products that do not have an image from a slider carousel for an ecommerce webpage?
- how do I get a specific post from a post with a subcategory in WP
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- filter default query to show just selected level of child pages in wordpress
- Automatically create child pages and grandchild pages when saving a (parent) page
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- Trying to build simple deposit code that hooks into woocommerce
- How to pick the default selected value in wordpress dropdown?
- Second transition_post_status hook fired instead of the first
- Add New User, extra fields which are required?
- How to store post ID’s in cookie or session to display the same posts later
- user_profile_update_errors hook not executing
- Send an email to specific adress when button is clicked?
- Which hook/action will help me solve my problem?
- How can I add extra word in permalink when someone click download button?
- Customizer: active_callback and sanitize_callback incompatibility?
- Saving and Restoring a Canvas on A Individual User Basis
- Redirect specific user role to specific site after login?
- Send multiple attachments with wp_mail in PHP
- WordPress admin pointers tour bug?
- custom url rewrite for wordpress
- Extend plugin Class through functions.php
- Post + form + action + results on the same page
- Open post-content in archive page in a Modal box with bootstrap
- How to add a do_action on refreshing of WP customizer?
- Customize position of social icons in upme plugin [closed]
- Weird 404 URL Problem – domain name being placed at end of urls
- How to get the value of input hidden html from text editor to custom page template?
- Make a list of sites for each user in WPMU – switch_to_blog (display in SITE_ID: 1)
- Menu jumping when calling it via PHP
- remove post that has no content
- Output Video Download Link in template
- Modify custom field input data before creating a new post
- Output custom field value to post string
- Loading index.php contents which located outside blog folder for post single page
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- get post content of particular post by url
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Media Upload , file name changed automatically
- Post repeating with infinite scroll
- Replace shortcode in substring
- Get children post mime type using parent post_ID wp_post
- How to show only subcategories in parent category not parent category?
- Need help enqueueing webfonts
- 404 error when I acess the second page of post-type
- need help with existing code showing subpages
- How do I add a custom css to all posts without affecting homepage css? [closed]
- how to show only specific category for a template