How to hide post published date?
Add entry-date { display: none; } to the stylesheet. Better create a child theme and add the code to the newly created stylesheet, if you dont you may lose the code when you update your theme to a latest version.
Add entry-date { display: none; } to the stylesheet. Better create a child theme and add the code to the newly created stylesheet, if you dont you may lose the code when you update your theme to a latest version.
Please use DateTime::getTimestamp() that returns unix timestamp. If you want to format the date according to your time zone then you try this. $datetime = new DateTime(“now”, new DateTimeZone(‘America/New York’)); echo $datetime ->format(‘m/d/Y, H:i:s’);
Timezone for Plugin
Option 1 (no code): you can manually edit each post and change the published date. Look in the “Publish” box where you publish or update posts, and there will be a “published on” date with an “edit” link. Option 2 (requires database access): you can run a MySQL query to adjust all posts’ dates. UPDATE … Read more
This is the part that is responsible for random date: //* Generate a random date between January 1st, 2015 and now $random_date = mt_rand( strtotime( ‘1 January 2015’ ), time() ); So you need to change it. And if you want to randomize only the time part, then this is one way to achieve that: … Read more
$post_id = 12; echo get_the_date( ‘Y-m-d’,$post_id);
Just gave an example of how to do it: $today_date = new DateTime( date( ‘Y-m-d’, strtotime( ‘today’ ) ) ); $register_date = get_the_author_meta( ‘user_registered’, get_current_user_id() ); $registered = new DateTime( date( ‘Y-m-d’, strtotime( $register_date ) ) ); $interval_date = $today_date->diff( $registered ); if( $interval_date->days < 31 ) { echo ‘With us ‘ . $interval_date->format(‘%d days’); … Read more
the_sub_field() echoes out the sub field. Use get_sub_field() instead.
There is a better method using date_query property of WP_Query class: ‘date_query’ => array( ‘column’ => ‘post_date’, ‘after’ => ‘- 1 days’ )
It depends on how this gets rendered in the theme you’re using. As you want to change things in one place to look different to the rest of the site, you’ll need to track down where that is and change the date format there. Finding where it is might be tricky but once you do … Read more