Home › Forums › Pro Support › Updated Date Meta from GeneratePress
Tagged: meta
- This topic has 21 replies, 2 voices, and was last updated 4 years, 3 months ago by
Tom.
-
AuthorPosts
-
April 9, 2018 at 9:35 pm #4151
Tom
KeymasterHere’s what I’m seeing: https://www.screencast.com/t/1bqa9qU5ct
The updated date is March 24, and that’s what I see on the actual post in the WPSP list.
Let me know 🙂
April 17, 2018 at 10:52 am #4250Todd
ParticipantTom, just checking in on this one when you have time.
April 27, 2018 at 8:13 am #4337Todd
ParticipantHi Tom, I am hoping to launch this site soon, and was hoping I could get the updated dates to show in WPSP? Any help would be much appreciated. Let me know if you need access to the site.
Thank you.
May 3, 2018 at 10:11 am #4379Todd
ParticipantTom, Seems like you made an update to updated dates in GP but I still can not get this to work for WPSP?
It shows the correct updated date, but not the words “Updated”, should just add content Before CSS? I was just concerned about the Google aspects of a solution like adding CSS this way.
I mo=ust be doing something wrong given the CSS class for the date is .wp-show-posts-updated
I am using the following Snippet to change the dates to Updated in GP.
if ( ! function_exists( 'generate_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function generate_posted_on() { $date = apply_filters( 'generate_post_date', true ); $author = apply_filters( 'generate_post_author', true ); //if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) $time_string .= '<time class="updated" 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() ) ); // If our date is enabled, show it if ( $date ) : printf( '<span style="float: left; margin-right: 3px;">Updated:</span><span class="posted-on">%1$s</span>', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string ) ); endif; // If our author is enabled, show it if ( $author ) : printf( ' <span class="byline">%1$s</span>', sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <a class="url fn n" href="%2$s" title="%3$s" rel="author" itemprop="url"><span class="author-name" itemprop="name">%4$s</span></a></span>', __( 'by','generatepress'), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ), esc_html( get_the_author() ) ) ); endif; } endif;
May 4, 2018 at 10:33 am #4387Tom
KeymasterSorry, Todd! The forum wasn’t notifying me of your replies for some reason.
To add the Updated text, you can just do this:
.wp-show-posts-updated:before { content: "Updated: "; }
May 4, 2018 at 11:11 am #4388Todd
ParticipantThanks Tom, worked like a charm. No worries.
May 4, 2018 at 4:21 pm #4396Tom
KeymasterAwesome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.