Hi, I changed the recent post widgets and also the secondary format in the forum theme because there are always cacher problems. Is there a way to save the changed RecentPosts.php outside of the plugin so that it is not overwritten during a plugin update? We added the wpforo theme to our wp theme. Maybe your developers could simply renew the entire time format in the plugin, because these days it's no longer possible without additional cacher systems, even if wpforo itself has one.
Thats the code changes in RecentPosts.php file for all are interesting:
<p class="posttext"><?php echo esc_html( wpforo_text( $post['body'], $instance['excerpt_length'], false ) ); ?></p> <p class="postuser"><?php wpforo_phrase( 'by' ) ?> <?php wpforo_member_link( $member ) ?> , <span class="uncached" style="white-space: nowrap;"> <?php $current_date = date("Y-m-d"); $last_post_date = date("Y-m-d", strtotime($post['created'])); if ($last_post_date === $current_date) { echo "heute um " . date("H:i", strtotime($post['created'])); } elseif ($last_post_date === date("Y-m-d", strtotime("-1 day"))) { echo "gestern um " . date("H:i", strtotime($post['created'])); } else { echo "am " . '<div class="full-date">' . date("d/m/Y, H:i", strtotime($post['created'])) . '</div>'; } ?> </span></p>
What is a "cacher" system?
You mean a Page caching plugin? An Object caching of the server?
Sorry is not my native language, yes we use wp-rocket
@spielo Ah, I understand
For example, I use
<?php esc_html( wpforo_date( $post['created'], 'd/m/Y g:i a' ) ) ?>
To show the full date and time (without today and yesterday)
But I will test your code, today and yesterday makes the date even clearer 😉