Meta Query Based on Month Range

The problem is that you’re passing a meta VALUE in the key field of the meta_query…you should be passing your meta KEY there (“_wccf_pp_event_date”), as in: $seasons = array ( ‘spring’ => array (‘2017-03-21’, ‘2017-06-20’), ‘summer’ => array (‘2017-06-21’, ‘2017-09-20’), ‘fall’ => array (‘2017-09-21’, ‘2017-12-20’), ‘winter’ => array (‘2017-12-21’, ‘2018-03-20’), ) ; foreach ($seasons as … Read more

display future posts in date page

You can alter the query with pre_get_posts before it’s run to include future posts: function wpd_future_date_archives( $query ){ if( $query->is_date() && $query->is_main_query() ) { $query->set( ‘post_status’, array( ‘publish’, ‘future’ ) ); } } add_action( ‘pre_get_posts’, ‘wpd_future_date_archives’ ); The posts won’t behave the same as published posts though- they have no pretty permalink until they’re published.

Sort / display recent posts by publish date

The Recent Posts widget, and the posts page for that matter, doesn’t display ordered by update date, it orders by published date. If it’s displaying by updated date then you must have a plugin somewhere that’s changing this behaviour, or are using something other than the standard Recent Posts widget.

Using system date format

Calling get_the_date( get_option(‘date_format’) ); will return the exact same value as get_the_date(); this is because by default if a date format is not specified when the function is called it will use get_option(‘date_format’); as can be seen from the following snippet taken from the get_the_date() function itself: if ( ” == $d ) { $the_date … Read more

Get Author Count By Day, Week and Month

I’m not where I can run the below, but potential typos, etc. aside, it should be able to point you in the right direction. 1) Limit Query You could add Date Parameters to your query arguments to limit them. $today = getdate(); $args = array( ‘date_query’ => array( array( ‘year’ => $today[‘year’], ‘month’ => $today[‘mon’], … Read more

Date Language doesn’t change

The date() is a native PHP function. Its output depends on PHP locale and timezone settings. In a typical WP environment that would be default English locale and UTC time zone (which WP sets during core boot). Since WP implementation of Date/Time component predates PHP 5 and its enhancements, it has a lot of own … Read more

Assigning Two Different Post Dates For Single Post

Have you tried the basic Custom Fields that WordPress includes automatically? If you don’t see it at the bottom of your Post edit screen, click the Screen Options button at the top-right of your editor window and check the box next to Custom Fields to make it visible. Once you can see it at the … Read more

How to remove a link of date archive

I don’t know which theme your are using, I am explaining you same thing for twenty seventeen theme, go to wp-content\themes\twentyseventeen\inc\template-tags.php, You will find function twentyseventeen_time_link() there. In this function you will get code as like return sprintf( /* translators: %s: post date */ __( ‘<span class=”screen-reader-text”>Posted on</span> %s’, ‘twentyseventeen’ ), ‘<a href=”‘ . esc_url( … Read more

How to update all posts at once?

I think you want to mass change old URLs in website database after migration. You can do it either by using plugin or manually. Plugin Method: The Velvet Blues Update URLs plugin enables you to change the URLs at various places, like posts and pages excerpts. Follow these steps: Install and activate Velvet Blues Update … Read more