btw i am using this code on my gp child theme.
add_filter( 'generate_post_date_output', db_modified_time_stamp, 20, 2);
function db_modified_time_stamp( $output, $time_string ) {
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Dipublish Pada : %2$s</time> ';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="updated" datetime="%3$s" itemprop="dateModified">Diperbarui Pada : %4$s</time> ' . $time_string;
}
// get modified time and published time. Compare the two, If modified date exists then ouput both time strings with modified date
$updated_time = get_the_modified_time( 'U' );
$published_time = get_the_time( 'U' ) + 86400;
if ( $updated_time > $published_time ) {
$time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified" style="display:inline;">Diperbarui Pada : %4$s</time>';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date('F j Y') ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date('F j Y') )
);
$post_date = new DateTime(get_the_date( 'Y-m-d' ));
$modified_date = new DateTime(get_the_modified_date( 'Y-m-d' ));
$current_date = new DateTime(date('Y-m-d'));
$published_date_interval = $post_date->diff($current_date);
$modified_date_interval = $modified_date->diff($current_date);
if ($published_date_interval->y < 2 || $modified_date_interval->y < 2 ){
return sprintf( '<span class="posted-on">%1$s </span>', // WPCS: XSS ok, sanitization ok.
sprintf( '%1$s',
$time_string
)
);
} if ($published_date_interval->y >= 2 || $modified_date_interval->y >= 2 ) {
return;
}
}
]]>Before updating to the latest version, I had the date in ‘Jalali’ format by the ‘WP Parsi date’ plugin.
Now it will not work anymore on Oceanwp, but on twenty twenty theme or other is okay.
also, The problem was not resolved by rollback to the previous version.
What prevents it?
Can it be due to font awesome 5?
Thanks in advance.
]]>Here is the link of My Site;
]]>I’m using Mystile as a theme, which comes with a timestamp. I removed the timestamp with the code
.type-post .meta .day {
display: none;
}
.type-post .meta .month {
display: none;
}
.type-post .meta .year {
display: none;
}
So that problem is solved. I would however like to show the date beneath the post title. I just don’t know how to. Does anyone have a solution for me?
]]>I wonder if anyone can help me resolve an on going problem…I HOPE SO!
Here is my site…
https://www.thevintageshowroom.com/blog/
When the post title, or ‘read more’, is clicked, the post is show in a single page. This is great but for some unknown reason the post title and the date shift out of place causing a rather ugly display… I wish them to just stay in place, as they are seen on the blog home page…
Many many thanks in advance for any help…
Nic.
]]>