Modify this line to give alternate format date?

Instead of using $post->post_date, use get_the_time( $format, $post ). The correct PHP date format string for your question is ‘d/m/y H:i’. … Assuming you want a two digit minute (even when less that 10 minutes). Also, I may have the month and day the wrong way around for you. The format argument in get_the_time() is … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)