- This topic has 9 replies, 2 voices, and was last updated 3 years, 9 months ago by Leo.
-
AuthorPosts
-
July 21, 2020 at 9:29 am #1371070WP
Hi,
I would like to display total comments below post title(h1) and before post description(paragraph). I looked around options but could not find such option. Also, I’ve added CrowdSignal thumbs up/down widget which is not aligned properly. I’m trying to have it displayed right below post title and once displaying total comments is possible, I could like to have thumbs up/down displayed before comments similar to below.
https://crowdsignal.com/features/July 21, 2020 at 11:15 am #1371166LeoStaffCustomer SupportHi there,
Can you:
– Disable the caching plugin first.
– Do you only want the comment link to display in single posts but not archives?
– As for CrowdSignal thumbs up/down widget, that’s something you will need to check with their support as the CSS is all from the plugin from what I can see.
July 21, 2020 at 11:56 am #1371233WPLeo,
This site is hosted in WordPress.com. I don’t see caching plugin being activated.Af for comments display link – I only want the link to display in single post (including total comments).
Let me check with CrowdSignal on resolving thumbs up/down widget position issue.
July 21, 2020 at 2:32 pm #1371399LeoStaffCustomer SupportOk this takes a couple of steps but try:
– Activate comment count for Archives in the customizer:
https://docs.generatepress.com/article/blog-content-layout/#archives– Add this PHP snippet:
add_filter( 'generate_header_entry_meta_items', function( $items ) { if ( is_single() ) { $items = array( 'comments-link', ); } return $items; } );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Then this CSS:
.single .comments-link { display: block; } footer.entry-meta .comments-link { display: none; }
Adding CSS: https://docs.generatepress.com/article/adding-css/
July 21, 2020 at 3:11 pm #1371423WP1. Activated comment count for archives
2. Added php code on child theme
3. added custom cssChecked the single post, but comment counts are not showing up anywhere (both comment link and counts).
https://pasteboard.co/JiJHgnj.png
https://pasteboard.co/JiJHxaO.pngJuly 21, 2020 at 3:40 pm #1371444WPFound why it was not displaying. Once I enabled ‘Display Post Author’ for Single on Blog Layout, comment link started showing up.
https://pasteboard.co/JiJRyTR.png
Two more question:
1. How can I move comments similar to below
2. Display #of post views stats similar to belowJuly 21, 2020 at 6:00 pm #1371519LeoStaffCustomer Support1. How are you adding the thumb up/down currently?
You would need to add it using the
after_entry_header
hook with a hook element in order to reposition them:
https://docs.generatepress.com/article/hooks-element-overview/2. You’d need a post view counter plugin.
July 23, 2020 at 3:52 pm #1374125WPLeo,
Thumb up/down are being displayed using CrowdSignal plugin. I have ticket open with their support to see if after_entry_header hook could be utilized.Regarding displaying comment link below title (in post meta), I wanted to replace ‘Leave a Comment’ with ‘Add Comment’ with below code, but it not replacing the text.
add_filter( 'generate_leave_comment','st_custom_leave_comment' ); function st_custom_leave_comment() { return 'Add Commment'; } add_filter( 'generate_header_entry_meta_items', function( $items ) { if ( is_single() ) { $items = array( 'comments-link', ); } return $items; } );
July 23, 2020 at 6:25 pm #1374193WPOk – this worked. It seems that WordPress.com business plan uses custom comment form.
add_filter( 'gettext', function( $text, $original, $domain ) { if ( 'Leave a comment' === $text && 'generatepress' === $domain ) { return 'Add Commment'; } return $text; }, 10, 3 );
July 23, 2020 at 9:17 pm #1374274LeoStaffCustomer SupportGlad you’ve figured out and thanks for sharing!
-
AuthorPosts
- You must be logged in to reply to this topic.