YearMonth datequery

To search for posts based on date, you can set up a quick instance of WP_Query. The best place to look is the official documentation, and in particular the section on the date parameters. A basic search for posts in a particular month will look a little like this: <?php $the_query = new WP_Query( array( … Read more

Filter posts by current date ( WP Post Carousel )

You can use WP_Query to query posts from Date A to Date B, here are all Date Parameters for the WP_Query object : //////Date Parameters – Show posts associated with a certain time and date period. //http://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters ‘year’ => 2014, //(int) – 4 digit year (e.g. 2011). ‘monthnum’ => 4, //(int) – Month number (from … Read more

Include post_date in search

I was able to receive the solution from the developer. Add the below code into functions.php and then rebuild the Relvanssi index. This worked for me. function rlv_index_post_date( $content, $post ) { $date = get_the_time( “F Y”, $post->ID ); $content .= ” $date”; return $content; } add_filter( ‘relevanssi_content_to_index’, ‘rlv_index_post_date’, 10, 2 );

Adding post date to ACF field

You can use the get_the_time() to get the post time . <?php get_the_time( $format, $featured_post->ID ); ?> See the tutorial https://codex.wordpress.org/Function_Reference/get_the_time

Compare date of user’s last posts

According to the codex, you’re manipulating get_most_recent_post_of_user()‘s returned value the wrong way. get_most_recent_post_of_user() directly returns the post_date_gmt among blog_id, post_id, and post_gmt_ts. Anyway, if you want to get the 2 last posts of a specific author, use WP_Query instead, which should by default get last posts in the order you need. $author_id = $author_id; $args … Read more

Want to display my custom date archive to date.php but dont know how

You will need to write a custom rewrite rule for this. Just copy the following code into your functions.php and flush rewrite rules. function xlinkerz_custom_archive_rewrite_rule( $rewrite_rules ) { $custom_slug = ‘custom_archive’; $year_rule = array( $custom_slug . ‘/([0-9]{4})/([0-9]{1,2})/?$’ => ‘index.php?year=$matches[1]&monthnum=$matches[2]’ ); $month_rule = array( $custom_slug . ‘/([0-9]{4})/?$’ => ‘index.php?year=$matches[1]’ ); // Merging rules $rewrite_rules = $year_archive … Read more