- This topic has 3 replies, 2 voices, and was last updated 4 years ago by
David.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
March 11, 2019 at 7:30 pm #836143
Matt
I’m trying to use date modified for my post date. It shows up fine on my desktop but does not show up when viewing on a mobile device or in mobile view of GeneratePress. Any help would be appreciated.
I’m using the following PHP snippet:
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;
I’m using the following CSS:
.posted-on .updated { display: block; float:left; margin-right: 3px; }
GeneratePress 2.2.2GP Premium 1.7.8March 12, 2019 at 7:50 am #836788David
StaffCustomer SupportHi there,
your CSS is within a media query, move it outside of that and it will work.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 12, 2019 at 6:43 pm #837201Matt
Thank You David. I moved the CSS to Simple CSS and it worked!
March 13, 2019 at 9:57 am #837967David
StaffCustomer SupportGlad to be of help
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.