- This topic has 7 replies, 2 voices, and was last updated 4 years, 5 months ago by
Leo.
-
AuthorPosts
-
December 7, 2018 at 11:22 pm #751209
manaadiar
Hi, I want the comment count to show in my single post like it shows in my content page.. Please see 1st screen shot which is the main page https://shippingandfreightresource.com/articles where I can see the comment count for the individual articles..
But when I open any individual post, comment count is not there..
without comment count on individual page
Can you pls assist, thanks..
Regards
ManaadiarDecember 8, 2018 at 8:49 am #751524Leo
StaffCustomer SupportHi there,
Looks like you are currently using a special function to display the entry meta?
If so can you copy and paste the function here?
Make sure to highlight the code and click the
code
button above so it shows up correctly.Let me know ๐
December 8, 2018 at 12:46 pm #751634manaadiar
Hi Leo, below is what I am using the functions.php but that was only to bring the post meta to the top instead of the bottom where it was
if ( ! function_exists( 'generate_post_meta' ) ) { add_action( 'generate_after_entry_title', 'generate_post_meta' , 'generate_after_entry_content', 'generate_footer_meta' ); /** * Build the post meta. * * @since 1.3.29 */ function generate_post_meta() { if ( 'post' == get_post_type() ) : ?> <div class="entry-meta"> <?php generate_posted_on(); ?> <?php generate_entry_meta(); ?> Estimated reading time = <?php echo reading_time(); ?> <?php endif; } }
December 8, 2018 at 6:18 pm #751737Leo
StaffCustomer SupportCan you try this:
if ( ! function_exists( 'generate_post_meta' ) ) { add_action( 'generate_after_entry_title', 'generate_post_meta' , 'generate_after_entry_content', 'generate_footer_meta' ); /** * Build the post meta. * * @since 1.3.29 */ function generate_post_meta() { if ( 'post' == get_post_type() ) : ?> <div class="entry-meta"> <?php generate_posted_on(); ?> <?php generate_entry_meta(); if ( is_single() ) { echo '<span class="comments-link">'; comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) ); echo '</span>'; ?> Estimated reading time = <?php echo reading_time(); ?> <?php endif; } }
December 9, 2018 at 7:38 am #752093manaadiar
Hi Leo, there was a missing } (just before the estimated reading time), but after I added it, it works.. BUT only on SOME articles its not working.. If you click the first link it works, but it doesn’t work on the second link.. Not sure why.. Any ideas..??
Works on
https://shippingandfreightresource.com/demurrage-and-detention-exporter-vs-shipping-line/
https://shippingandfreightresource.com/demurrage-detention-and-port-charges/
Doesn’t work on
https://shippingandfreightresource.com/will-the-container-industry-ever-forget-fob/
https://shippingandfreightresource.com/difference-between-a-freight-forwarder-and-nvocc/
Any suggestions as all are posts done the same way.. Puzzling..
December 9, 2018 at 12:19 pm #752259Leo
StaffCustomer SupportCan’t see any reason why it would only work in some posts.
Can you try this filter instead?
add_filter( 'generate_post_author_output','tu_no_author_link' ); function tu_no_author_link( $output ) { echo $output; generate_entry_meta(); if ( is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo '<span class="comments-link">'; comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) ); echo '</span>'; } }
December 9, 2018 at 9:52 pm #752460manaadiar
Hi Leo, I see now that the other posts are working and displaying fine without any change.. Thanks..
December 10, 2018 at 8:48 am #752983Leo
StaffCustomer SupportNo problem ๐
-
AuthorPosts
- You must be logged in to reply to this topic.