Get system timestamp in wordpress

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

Use esc_attr() to print month name in French

Here is my solution, which has been tested and works: // Timestamp to format (defaults to current time) $timestamp = time(); // Set language code $dateformat = new IntlDateFormatter( ‘fr_FR’, // Use valid Locale format IntlDateFormatter::LONG, IntlDateFormatter::NONE ); // Set date format $dateformat->setPattern(‘MMMM’); // Echo (and capitalize) formatted timestamp echo ucfirst( $dateformat->format( $timestamp ) ); … Read more

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 change text (date) in post base on the day

Here’s summed up what you need to do: Get a meta box library. Add custom fields with dates Attach a filter callback action to the_content filter Get the current date, check your custom fields, append date in content. So here’s the filter callback, that lets you append your “next date”: function wpse66615_date_to_content( $content ) { … Read more