- This topic has 22 replies, 2 voices, and was last updated 2 years, 2 months ago by
Tibs.
-
AuthorPosts
-
May 30, 2020 at 4:31 pm #1308177
Tom
Lead DeveloperLead DeveloperNow change your date filter to this:
add_filter( 'generate_post_date_output', function( $output, $time_string ) { $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>'; $updated_time = get_the_modified_time( 'U' ); $published_time = get_the_time( 'U' ) + 86400; if ( $updated_time > $published_time ) { $time_string = 'Updated <time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">%4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); return sprintf( ' <span class="posted-on">%s</span> ', $time_string ); }, 10, 2 );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 30, 2020 at 4:41 pm #1308180Tibs
Ok, so here are how my current snippets look like:
Only Show Updated Date: http://prntscr.com/sqvali
Author/Date: http://prntscr.com/sqvase
Custom CSS: http://prntscr.com/sqvayiDid I get that right?
If so, any way I can add a separator between author and date: http://prntscr.com/sqvba2?
May 31, 2020 at 11:18 am #1308992Tom
Lead DeveloperLead DeveloperLooks good! Try this CSS:
.entry-header .entry-meta > *:not(:last-child):after { content: " | "; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 31, 2020 at 5:16 pm #1309218Tibs
That worked π
I’ll keep an eye out for the date on Google and will let you know if it worked. Thanks again Tom!
June 1, 2020 at 9:28 am #1310064Tom
Lead DeveloperLead DeveloperNo problem π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 3, 2020 at 7:02 pm #1313437Tibs
The date updates in Google!
Thanks Tom! You’re the man π
(Just out of curiosity, what plugin would you recommend for Schema Markup? Star rating, review box, product details, etc.)
June 4, 2020 at 9:56 am #1314511Tom
Lead DeveloperLead DeveloperI don’t really have a go-to one. I would suggest going the JSON-LD route vs. HTML. There should be a lot of options out there if you search “WordPress JSON-LD” π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 4, 2020 at 5:55 pm #1314896Tibs
Will do, thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.