Comment time is same as the post time

Try to use the wp_list_comments function: http://codex.wordpress.org/Function_Reference/wp_list_comments It allows you to control the aspect of every comment, also the replies. Then, you define a callback function, which will be called when WordPress creates each comment. Your callback needs to start like this: function commnents_callback($comment, $args, $depth) { $GLOBALS[‘comment’] = $comment; global $post; // your HTML … Read more

How to handle dates, trying to calculate time since a post

You don’t need to know the user’s timezone, because time since the post was published is independent of timezone. WordPress sets your timezone to UTC so that internally, all dates are dealt with the same and consistent timezone. You should avoid using php functions, and instead use the WordPress provided functions. Incidently, human_time_diff() does exactly … Read more

Change the counter in terms of date

Hope these plugins will be helpful http://wordpress.org/extend/plugins/date-in-a-nice-tone/ http://wordpress.org/extend/plugins/wp-relativedate http://www.jasonhendriks.com/programmer/dynamic-dates/dynamic-dates-examples/

Advanced Custom Fields and date picker, show posts only if the day is today no matter the year

It’s a little complicated, but we can do this by directly modifying the query with a filter on posts_where. We’ll start with a query for posts with a meta value of today’s date, this is assuming a date format of yyyy-mm-dd: $date_today = date(‘Y-m-d’); $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ … Read more

Time sort with meta_key using UNIX timestamp failing due to date differences

I will caveat this by saying that I am still not 100% sure I know what you are doing, but I believe the following will sort your results by time only assuming that your meta values are proper Unix timestamps. function orderby_time_only($orderby) { remove_action(‘posts_orderby’,’orderby_time_only’); return preg_replace(‘|(.*)\s(.*)|’,’DATE_FORMAT(FROM_UNIXTIME($1),”%k%i”) $2′,$orderby); } add_filter(‘posts_orderby’,’orderby_time_only’); $args = array( ‘post_type’ => ‘event’, … Read more

How to second orderby in “pre_get_posts” by meta value or combine single date and time to timestamp

I’m outlining a solution for what you asked in your last comment, because this wouldn’t been fitting for the comment format. Code: function date_time_to_timestamp_meta( $post_id ) { // meta fields are saved in DATETIME, e.g. »2013-12-09 22:32:12« // here is only the date part relevant $datetime_date = get_post_meta( $post_id, ‘_start_date’, true ); // here is … Read more