- This topic has 11 replies, 2 voices, and was last updated 3 years, 4 months ago by Leo.
-
AuthorPosts
-
October 30, 2020 at 10:18 am #1511424Linda
I have searched the forum and reviewed similar questions but I can’t seem to figure out why the author is not showing on the single post page. On my front page I am using WP Show Posts and the author appears there, but when you click to see main post, the author is not there. Any ideas appreciated, thanks.
October 30, 2020 at 10:40 am #1511453LeoStaffCustomer SupportHi there,
Is it activated in the customizer?
https://docs.generatepress.com/article/blog-content-layout/#singleOctober 30, 2020 at 11:14 am #1511499October 30, 2020 at 11:35 am #1511520LeoStaffCustomer SupportLooks like you are using some custom functions for the entry meta.
Can you share the code here?
Let me know π
October 30, 2020 at 11:48 am #1511539LindaUsing 2 snippets, 1 of 2 here
//https://docs.generatepress.com/article/generate_post_date_output/#remove-link-from-date
//This code will remove the published date HTML if an updated date exists.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 = '<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 );
October 30, 2020 at 11:48 am #1511540LindaSnippet 2 of 2 here:
add_filter( 'wpsp_date_output', 'tu_wpsp_updated_date_first' ); function tu_wpsp_updated_date_first() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string .= '<time class="wp-show-posts-updated" datetime="%3$s" itemprop="dateModified">%4$s</time>'; } $time_string .= '<time class="wp-show-posts-entry-date published" datetime="%1$s" itemprop="datePublished">%2$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 $output = sprintf( '<span class="wp-show-posts-posted-on wp-show-posts-meta"> <a href="%1$s" title="%2$s" rel="bookmark">%3$s</a> </span>', esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string ); return $output; }
October 30, 2020 at 11:54 am #1511556LindaAlso sending login info to my (sloppy) staging site
October 30, 2020 at 6:44 pm #1511789LeoStaffCustomer SupportCan you remove the first function first?
Let me know π
October 30, 2020 at 7:00 pm #1511798LindaRemoving first one, then both of the snippets caused no change in the single post page (after clicking on the read more)
October 30, 2020 at 9:24 pm #1511848LeoStaffCustomer SupportCan you first clear and disable all the caching plugins you are using?
October 31, 2020 at 8:34 am #1512509LindaI did try removing the caching plugin, but it had no effect.
However, I did get it working after much trial and error, but don’t ask me why it now works, maybe because it’s Halloween? I have this plugin installed, https://wordpress.org/plugins/wp-last-modified-info/. I made no changes except to save (again) the settings in that plugin. Now the author name shows up. It’s a mystery, but at least it’s working. Thanks so much for helping me troubleshoot!October 31, 2020 at 10:21 am #1512624LeoStaffCustomer SupportNo problem π
-
AuthorPosts
- You must be logged in to reply to this topic.