Set post beginning date and final date
Set post beginning date and final date
Set post beginning date and final date
I found a solution which displays the posts ordered by the date value, and also removes the past ones. <div class=”container”> <div class=”row”> <table> <tr> <th>Artista</th> <th>Fecha</th> <th>Ciudad</th> <th>Información</th> </tr> <?php $today = current_time(‘Ymd’); $args = array( ‘post_type’ => ‘evento’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => ‘-1’, ‘meta_query’ => array( array( ‘key’ => ‘fecha_del_evento’, ‘compare’ => … Read more
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