Get month and day from a Date Picker custom field
Get month and day from a Date Picker custom field
Get month and day from a Date Picker custom field
Look for the code that displays the post date. It should look something like the following: Posted on: <?php the_time(‘l, F jS, Y’) ?> Now replace it with the following code (slightly modified from Ardamis’ post): Posted on <?php the_time(‘F jS, Y’) ?> <?php $u_time = get_the_time(‘U’); $u_modified_time = get_the_modified_time(‘U’); if ($u_modified_time != $u_time) { … Read more
I think you should make a recursion function that will call itself if there’s no posts found passing new date to query for.. function getDatePosts( $date, $query_args ) { $query_args[‘date_query’] = array( ‘year’ => date( ‘Y’, $date ), ‘mounth’ => date( ‘m’, $date ), ‘day’ => date( ‘d’, $date ) ); $query = new WP_Query( … Read more
How to get to the date of the uploaded file
date archive future posts
Normally you would write a function that gets called by the save_post hook, and use wp_update_post to update the post. The problem is, when you call wp_update_post it calls save_post, which will cause an infinite loop. To get around that, we will unhook our function before calling wp_update_post, then re-hook it afterward. I have not … Read more
Use the_date with link
I’ve found the code below that does what I want except it isn’t accurate to the hour. It is only accurate to the whole day, so if my post expires in the morning it still shows it as current in the afternoon. How would this be able to be more accurate to the hour? <?php … Read more
You need to compare the year value between the current post and the previous post and based on that display your h3 tag with your year-based content I’m not going to reproduce your code, only the important parts. Note that I may need to strip some tags in order to add my section of code … Read more
PHP handles all content inside single quotes as string therefore your code does not work as expected. You should remove quotes from $today in meta_query and from true in suppress_filters