Replace ‘published on date’ with ‘modified on date’ on Posts
You just need to compare values of get_the_post_time() and get_the_modified_time(). if ( get_the_post_time() == get_the_modified_time() ) { // Published on… } else { // Modified on… }
You just need to compare values of get_the_post_time() and get_the_modified_time(). if ( get_the_post_time() == get_the_modified_time() ) { // Published on… } else { // Modified on… }
I’m afraid it won’t be possible without any coding, but… It shouldn’t be so hard to achieve. I would approach it this way: Schedule post for publication using native post date. Store the real publication date as some custom field. Add custom action to transition_post_status hook and replace the publish date with the one stored … Read more
The same date is always displayed because of the use of echo get_the_date(‘F j, Y’). As you can read in the documentation: The get_the_date template tag retrieves the date the current $post was written. Change get_the_date(‘F j, Y’) to get_the_date(‘F j, Y’, $value->ID) and it should work. Or without additional DB queries: <div class=”c-singlepost__sidebar__articles-item-date”> <span> … Read more
get_the_modified_date should do what you’re looking for. I am guessing that perhaps you are struggling a bit with the sprintf syntax. $date = sprintf( ‘<span>’ . __( ‘Posted’, ‘theme’ ) . ‘ <a href=”%3$s”><time class=”entry-date” datetime=”%1$s”>%2$s</time></a></span>’, esc_attr( get_the_date( ‘c’ ) ), esc_html( time_ago() ), esc_html( get_day_link( get_the_date(‘Y’), get_the_date(‘m’), get_the_date(‘d’) ) ) ); Let’s break it … Read more
i have found a solution, making a custom SQL query here is the code ( using WPML ) $startday = date(“Y-m-d”); if ( defined( ‘ICL_LANGUAGE_CODE’ ) ) { $lang = ICL_LANGUAGE_CODE; } //echo $startday; global $wpdb,$post; $results = $wpdb->get_results( “SELECT * FROM wp_posts, `wp_mec_dates` AS mecd, wp_icl_translations WHERE wp_posts.ID = mecd.post_id and post_status=”publish” AND wp_icl_translations.language_code=”$lang” … Read more
there is a custom function in wordpress called date_i18n. so basically you do echo date_i18n( ‘H:i d-m-Y’, $ts ); without the setLocale stuff.. find the function date_i18n and its parameters here. you could even build in your translation all in there, without the language check before: date_i18n( __( ‘H:i d-m-Y’, ‘textdomain’ ) ); (replace ‘textdomain’ … Read more
In case anyone encounters this in the future: after drilling down into the WP source and the database, it turns out that when media files are uploaded, WP still needs to attach them to some post, and for some reason, even though the post_id is 0 in the fuction which processes media uploads, it managed … Read more
Try this. It works wp_date( ‘Y/m/d – h:i:s’, 1598205923, new DateTimeZone(‘Asia/Tehran’) )
http://wordpress.org/extend/plugins/oldest-2-newest-redux/ it takes your oldest post and reposts it in the front every 24 hours, but you can change the hours on the php file in the plugin folder not sure if this is what u are looking for.
You’ll have to create your own but you can copy the code and customize from /wp-includes/default-widgets.php If you edit the defaults they’ll screw up when you update WP.