- This topic has 29 replies, 4 voices, and was last updated 3 years, 2 months ago by Simon.
-
AuthorPosts
-
February 25, 2021 at 2:43 am #1671815Simon
And just looking for gravatar image, Author and number of comments
February 25, 2021 at 3:57 am #1671908DavidStaffCustomer SupportI can’t see the CSS that is provided in the example on your site.
February 25, 2021 at 4:39 am #1671960SimonHi Dave, yeah I keep deleting it because it looks bad and don’t want too many people seeing it.
I have readded and will keep it there.
I think it just needs styling now?
The tricky thing might be adding comment counts which could be tricky as it’s not showing as a template tag option.
February 25, 2021 at 6:40 am #1672096SimonHello? Please answer. Or at least tell me how to put in a complaint.
February 25, 2021 at 7:13 am #1672324DavidStaffCustomer SupportI still can’t see the CSS provided in that example on your site ie. this:
.page-hero-gravatar img { width: 40px; height: 40px; border-radius: 50%; position: relative; vertical-align: middle; margin: 0 10px 0 0; } .page-hero .author, .page-hero-gravatar { display: inline-block; } .page-hero .entry-date { border-left: 2px solid #fff; padding-left: 10px; margin-left: 10px; }
Where have you added it ?
Please – if you can afford us a little patience .. we try to respond to all requests within 24hrs. Our average times are significantly below that and when dealing with Custom development requirements we have to balance these very time consuming topics with the rest of our support users.
February 25, 2021 at 7:29 am #1672357SimonSorry David, please forgive me. Just getting frustrating at my own inadequacies, not you. I do appreciate the team and I know it’s frustrating when it seems people aren’t listening to the advice you’ve already given.
I am trying to follow, I’m just completely lost, to be honest.
We’re nearly there though, here’s what it looks like right now after adding the code you sent:
I think just need to change author name (link) colour and add number of comments, but as I say, that’s no template tag for that?
February 25, 2021 at 7:40 am #1672370DavidStaffCustomer SupportNo problems π
Comments link requires another shortcode to be registered. Leo provides a method here:https://generatepress.com/forums/topic/number-of-comments-in-header-element/#post-1652207
Once the code is added you can include that in the hero element.
Link Colors if you edit the Header Element – there is a Link Color option for this.
This will be so much easier with GPP 2.0 Block Element!
February 25, 2021 at 8:13 am #1672421SimonOh, my mistake, I thought the 2.0 you were referring to was the theme update yesterday…
Adding comments count still isn’t working and I can’t find out why.
I added the snippet:
Then added custom field inside page hero:
Am I missing something?
February 25, 2021 at 8:35 am #1672469DavidStaffCustomer SupportReplace:
{{custom_field.comment_number}}
with:
[comment_number]
GPP 2.0 is the premium update its currently in Alpha:
February 25, 2021 at 8:58 am #1672514SimonIt’s looking amazing now. Thank you!!!
Lastly, you gave this code to stylise the size. I tried changing entry-date to comment-count but must be wrong.
.page-hero-gravatar img { width: 40px; height: 40px; border-radius: 50%; position: relative; vertical-align: middle; margin: 0 10px 0 0; } .page-hero .author, .page-hero-gravatar { display: inline-block; } .page-hero .entry-date { border-left: 2px solid #fff; padding-left: 10px; margin-left: 10px; }
February 25, 2021 at 9:02 am #1672519SimonLast thing, sorry. It doesn’t show when 0 comments. Can get it to say ‘0 comments’ when no comments?
Thank you again π
February 25, 2021 at 9:04 am #1672523DavidStaffCustomer SupportIn the shortcode PHP – look for this line:
comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) );
And change it to:
comments_popup_link( __( '0 Comments', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ), 'comment-count' );
You can then target:
.page-hero .comment-count { /* your styles */ }
February 25, 2021 at 9:22 am #1672545SimonThanks, 0 comments still not showing though.
Neither before or after adding this:
.page-hero .comment-count { border-left: 2px solid #fff; padding-left: 10px; margin-left: 10px; }
February 25, 2021 at 9:59 am #1672588TomLead DeveloperLead DeveloperHi there,
In your shortcode, try replacing this:
if ( $comments > 0 ) { comments_popup_link( __( '0 Comments', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ), 'comment-count' ); }
With this:
comments_popup_link( __( '0 Comments', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ), 'comment-count' );
Right now the
if ( $comments > 0 )
is making it so it only displays if there are comments.February 25, 2021 at 10:11 am #1672605SimonPerfect! Thank you! Now I’ll leave you all in peace π
-
AuthorPosts
- You must be logged in to reply to this topic.