Return date in French

Bonjour 🙂 you can use the function date_i18n, e.g. like this $dateToDisplay = time(); echo date_i18n(get_option(“date_format”), $dateToDisplay); look in the codex for more informations https://codex.wordpress.org/Function_Reference/date_i18n

Shortcode is not returned correctly

You should not echo any content in your shortcode. the_weekday() function echos the date. You can use output buffering or directly get the date: Output buffering: function custom_shortcode() { ob_start(); the_weekday(); $week = ob_get_contents(); ob_end_clean(); return ‘<img src=”https://wordpress.stackexchange.com/wp-content/themes/coworker/images/daily-social-image-” . $week . ‘.gif” width=”100%” />’; } add_shortcode( ‘weekday’, ‘custom_shortcode’ ); Or use the global $wp_locale to … Read more

Unique Problem with the php date and get_posts

date returns a string but you are using integers in the switch statement. Use: case ’01’: $dateY = date(‘Y’)+1; break; etc. However, the switch code can be much simpler, and there is no need to call the date function again since dateY has already been initialised in advance: switch($dateM) { case ’01’: case ’02’: case … Read more

Convert Gravity Form Entry Date on Export

You can’t modify date_created on Export Gravity Forms date_created field isn’t actually a field that’s affected by that hook. If you look in /exports.php you’ll find in start_export() that they bypass the filter for ID’s date_created and payment_date and hard-code force the use of Y-m-d H:i:s foreach ( $leads as $lead ) { GFCommon::log_debug( __METHOD__ … Read more

Add Date and Author to Posts

Use the following code in file template single.php (https://developer.wordpress.org/reference/functions/get_day_link/#user-contributed-notes ) : <?php $archive_year = get_the_time( ‘Y’ ); $archive_month = get_the_time( ‘m’ ); $archive_day = get_the_time( ‘d’ ); $month= get_the_date(‘M’); ?> <div class=”custom_archives”> <p> Posted on: <a href=”https://wordpress.stackexchange.com/questions/310792/<?php echo esc_url( get_day_link( $archive_year, $archive_month, $archive_day ) ); ?>”><?php echo $month. ” “.$archive_day.”, ” .$archive_year; ?> </a> </p> … Read more