[Resolved] Project Site Layout

Home Forums Support [Resolved] Project Site Layout

Home Forums Support Project Site Layout

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #1671815
    Simon

    And just looking for gravatar image, Author and number of comments

    #1671908
    David
    Staff
    Customer Support

    I can’t see the CSS that is provided in the example on your site.

    #1671960
    Simon

    Hi 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.

    #1672096
    Simon

    Hello? Please answer. Or at least tell me how to put in a complaint.

    #1672324
    David
    Staff
    Customer Support

    I 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.

    #1672357
    Simon

    Sorry 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:

    whatitlookslikenow

    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?

    #1672370
    David
    Staff
    Customer Support

    No 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!

    #1672421
    Simon

    Oh, 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:

    snippet

    Then added custom field inside page hero:

    page hero

    Am I missing something?

    #1672469
    David
    Staff
    Customer Support

    Replace:

    {{custom_field.comment_number}}

    with:

    [comment_number]

    GPP 2.0 is the premium update its currently in Alpha:

    https://generatepress.com/category/development/

    #1672514
    Simon

    It’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;
    }
    #1672519
    Simon

    Last thing, sorry. It doesn’t show when 0 comments. Can get it to say ‘0 comments’ when no comments?

    0comments

    Thank you again πŸ™‚

    #1672523
    David
    Staff
    Customer Support

    In 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 */
    }
    #1672545
    Simon

    Thanks, 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;
    }
    #1672588
    Tom
    Lead Developer
    Lead Developer

    Hi 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.

    #1672605
    Simon

    Perfect! Thank you! Now I’ll leave you all in peace πŸ™‚

Viewing 15 posts - 16 through 30 (of 30 total)
  • You must be logged in to reply to this topic.