Get last revision author, author-link and date

To get the_modified_author() we have to look in the folder wp-includes and search for the author-template.php. Line 101 shows: /** * Display the name of the author who last edited the current post, * if the author’s ID is available. * * @since 2.8.0 * * @see get_the_author() */ function the_modified_author() { echo get_the_modified_author(); } … Read more

pre_get_posts query between 2 dates (date stored in custom post meta)

You can always use a BETWEEN comparison in your query, I have used this, maybe you can adapt it to work in your situation. It avoids doing multiple checks for no reason 🙂 $first_date = 110501; $second_date = 170514; $meta_query = array( ‘key’ => ‘_exm_date’, ‘value’ => array($first_date, $second_date ), ‘type’ => ‘DATE’, ‘compare’ => … Read more

I don’t arrive to do order_by title when i have a conditionnal year in a request

I tried your code and is working fine for me $args = array( ‘post_type’ => ‘project’,’posts_per_page’ => -1,’year’ => date(‘Y’) – 2, ‘orderby’=> ‘title’,’order’ => ‘ASC’); $myposts = get_posts( $args ); The thing is as you can see he is only fetching the posts from 2015. If you don’t have any posts with the publish … Read more

Orderby ASC changes to DESC in WP_Query

You’ve made “orderby” and “order” part of the date_query sub-array. “Order” parameters belong to the main parameters array. I can’t vouch for the part of your code that concerns the year and the above-undefined variable $ppy, but if you want the posts from a specified year in ascending order by ‘post_date’ (which is the default), … Read more