- This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago by
Ying.
-
AuthorPosts
-
July 27, 2021 at 10:14 am #1873268
Allen
hi
a) Can I know how can I put author’s comment date to right side. Currently its under author’s name.
b) And how can I include “Day” and “Name of the day” (e.g Thursday) to the date. I tried to add in “Settings” but it will appear on my blog post as well. I only wish these to appear in comments section.What I wish to achieved is shown in the screenshot.
Thank you!July 27, 2021 at 10:56 am #1873325Ying
StaffCustomer SupportHi Allen,
a) Try this CSS:
.single-post .comment-author-info { display: flex; flex-wrap: wrap; } .single-post .comment-author.vcard { margin-right: 20px; }b) Can you add the Day in at Settings, and link us to your blog, so we can see what to do from there?
July 27, 2021 at 11:45 am #1873379Allen
hi Ying!
a) Work perfectly! Thank you!!
b) I have added “day” and “Name of the day” to settings. Now just need to remove “Name of the day” from blog post’s date.July 27, 2021 at 2:34 pm #1873531Ying
StaffCustomer SupportGive this PHP a try:
add_filter( 'generate_post_date_output', function() { $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s %5$s</time> '; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="updated" datetime="%3$s" itemprop="dateModified">%4$s %6$s</time> ' . $time_string; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date( 'Y年n月j日' ) ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date( 'Y年n月j日 l' ) ), esc_html( get_the_date( '\a\t H:i' ) ), esc_html( get_the_modified_date( '\a\t H:i' ) ) ); return sprintf( '<span class="posted-on">Published: %1$s</span>', // WPCS: XSS ok, sanitization ok. sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string ) ); } );Adding PHP: https://docs.generatepress.com/article/adding-php/
c) Do you know how to display 周三 instead of 星期三? Just to prepare in case my client asked.
Not sure about this one, the translation is done by WordPress.
I would recommend reaching out to WordPress 🙂July 27, 2021 at 11:16 pm #1873849Allen
Thank you, exactly what i want.
July 28, 2021 at 10:24 am #1874881Ying
StaffCustomer SupportYou are welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.