post_modified = post_date
post_modified = post_date
post_modified = post_date
There are probably several ways to solve this. Here is a general outline of what popped into my mind first. Create a custom plugin to house your custom feature code and to make it independent of the used theme Register a custom admin menu page to serve as a settings page Register a custom setting, … Read more
WordPress is not multilingual out of the box. It needs a third party plugin to be. The date will be displayed as defined in the settings according the website language also defined in the WordPress settings? Regards
date_default_timezone_set can alter the output of a new DateTime. Not sure how it will affect get_the_time. $date = new DateTime( get_the_time(‘c’) ); $date->setTimezone(new DateTimeZone(‘Europe/Warsaw’)); echo $date->format(‘c’); $date = new DateTime(); echo $date->format(‘c’); // 2015-12-18T18:21:31+00:00 $date->setTimezone(new DateTimeZone(‘Europe/Warsaw’)); echo $date->format(‘c’); // 2015-12-18T19:21:31+01:00 date_default_timezone_set(‘Europe/Warsaw’); $date = new DateTime(); echo $date->format(‘c’); // 2015-12-18T19:21:31+01:00
Little dirty but fast solution is to hide it via css. add this code to custom css .home .td-big-grid-post .td-post-date { display: none; } Better approach would be to find a template file or function responsible for this section and remove or change it…
If you want to get the dates of all blog posts then you’ll need to perform your own query and loop that. This is the query: <? $posts = new WP_Query(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1 )); ?> Now you’ll need to loop those posts like so: <? if( $posts->have_posts() ) : while( $posts->have_posts() … Read more
I was able to make my local WP installation display the date in French: switch_to_locale( ‘fr_CA’ ); echo wp_date( ‘F d’ ); Output: octobre 11 (Note that I didn’t have to localize my date format string (ie, no __() inside the wp_date() call.) However, when I tried Dutch: switch_to_locale( ‘nl_NL’ ); echo wp_date( ‘F d’ … Read more
global $wp_locale; echo $wp_locale->get_month( date( ‘m’ ) );
Find by myself. Just forget to declare $user = wp_get_current_user();
You can use PHP’s date() function here, but usually first you’ll need to run date_default_timezone_set. UTC+1 looks like Central Europe time from what I can tell, so here’s what I’d run: <?php date_default_timezone_set(‘Europe/Berlin’); echo date( ‘D, d M Y H:i:s’, now() ); ?> That will print out the current time from your server. If you’re … Read more