Docker Container time & timezone (will not reflect changes)

The secret here is that dpkg-reconfigure tzdata simply creates /etc/localtime as a copy, hardlink or symlink (a symlink is preferred) to a file in /usr/share/zoneinfo. So it is possible to do this entirely from your Dockerfile. Consider: ENV TZ=America/Los_Angeles RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone And as a bonus, TZ will … Read more

How to add publish date in the title

if the output you see is ABC [post_published], then it means your shortcode isn’t working as it should. try including following code at the end of inside your theme’s functions.php file. function ppd_shortcode(){ return get_the_date(); } add_shortcode(‘ppdate’, ‘ppd_shortcode’); When you register a shortcode using the add_shortcode function, you pass in the shortcode tag ($tag) and … Read more

Display time difference (6 hours ago) in a Soliloquy caption

In your filter function you should pass post ID to get_the_time() function, otherwise you will get the date from current post. function wpse_relative_date( $date, $format, $post ) { return human_time_diff( get_the_time(‘U’, $post), current_time( ‘timestamp’ ) ) . ‘ ago’; } add_filter( ‘get_the_date’, ‘wpse_relative_date’, 15, 3 ); References: get_the_time() function get_the_date filter

I am trying to get cutom post cout by month of current taxonmy term

you can do that with WordPress functions like that : $post_type = “tesekkur”; $timestamp_start = strtotime(“first day of next month -1 year midnight”); $start = date(“Y-m-d H:i:s”, $timestamp_start); $posts = get_posts([ “nopaging” => TRUE, “post_type” => $post_type, “date_query” => [ “after” => $start, ], ]); // sort by month $tab = []; foreach ($posts as … Read more

How display modified date of most recent modified post in wordpress?

This works for me. Place this in your functions.php file: function prefix_last_modified_date() { $last_modified_date = null; $args = array( ‘post_type’ => ‘post’, // could be page, or a CPT ‘orderby’ => ‘modified’, ‘post_count’ => 1, ); $last_modified = new WP_Query( $args ); if ( $last_modified->have_posts() ) { $last_modified->the_post(); $last_modified_date = get_the_modified_date(); } wp_reset_postdata(); return $last_modified_date; … Read more

Remove the month and year from a WordPress Date?

You’ll need to write your OWN function that will take the post_date and return it reformatted to the style you’re looking for. function my_date($input_date) { return date(“S”, strtotime($input_date)); } And then you would call it within your Pods Template like {@post_date, my_date} All rights goes to Jim True. More infomations : https://pods.io/forums/topic/date-formatting-using-magic-tags/