How to add correct Last update in Postings (the_modified_time)

You could compare post_date to post_modified and only echo your content if they do not match. // inside a Loop if ($post->post_date != $post->post_modified) { ?> <span style=”font-size:85%”>Last update <u><time datetime=”<?php the_modified_time(‘d-m-y’); ?>”> <?php the_modified_time(‘l j F, Y’); ?></time></u></span><?php } If you want “significant” updates, though, you will need to determine what counts as significant … Read more

How do I convert all custom_field php timestamps in the database to js timestamps?

ACF using milliseconds is not standard for timestamps, and nor is it useful. How much accuracy do you need? Bear in mind that converting to something like yyyymmdd will not accommodate timezones. If you have access to PHPMyAdmin (or similar) and know your way around SQL, running a quick query would probably be the easiest … Read more

Redirect to URL if x number of days passed

To redirect after 3 days gone after publication, hook into template_redirect, check if is a singular cpt view, check the date and compare to current time and redirect if needed. In the 3 days time frame, check if stats is is the query vars and if so redirect to post page. add_action(‘template_redirect’, ‘check_the_date_for_stats’); function check_the_date_for_stats() … Read more

change the post time on multiple posts

If you have the id of the posts, you can use wp_update_post and change the post_date. foreach ($postId as $id) { // random hour and time. You can also manually set these. $h = rand(1, 23); $i = rand(0, 59); $newDate = array( ‘ID’ => $id, ‘post_date’ => “2013-12-19 $h:$i:59” // [ Y-m-d H:i:s ] … Read more

Comparing Dates from custom field

Well, the exact server time/timestamp can be retrieve with current_time function. And comparing your date format, it would need to be Ymd. So combining these two thing, the proper comparison for you should be – $key = get_post_meta( $post->ID, ‘Due’, true ); $date = date(‘Ymd’, current_time(‘timestamp’) ); if( $key >= $date ) { // note … Read more

Date is wrong on ‘all posts’ page

It could be because you are not supplying post id in time parameter function. In place of the_time(‘d F’) try using echo get_the_time(‘d F’m $post->ID) because it will give you the flexibility to supply post id when you are in a loop. Reference: get_the_time Codex EDIT My bad, I guess $post variables are not being … Read more

How to add a date creation field when a custom taxonomy relationship is created?

Yes, is doable. I suggest you to add a custom field when some terms of that specific taxonomy are added to the post. You should also delete that custom field when all the terms are removed from same post. That can be done using ‘set_object_terms’. Please read the comments in code for more explaination: add_action( … Read more