[Resolved] Possible to put anchor text/link beside date?

Home Forums Support [Resolved] Possible to put anchor text/link beside date?

Home Forums Support Possible to put anchor text/link beside date?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1028544
    Carol

    In this theme, is it possible to add a phrase that’s hyperlinked to comments beside the date?

    Like this:

    Thank you.

    X80Ws+031v45

    #1028577
    Leo
    Staff
    Customer Support

    Hi there,

    Try this PHP snippet:

    add_filter( 'generate_post_date_output', function( $output ) {
        echo $output;
    
        if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
            echo '<span class="comments-link">';
                comments_popup_link( __( '0 comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) );
            echo '</span>';
        }
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know if this helps πŸ™‚

    #1028586
    Carol

    Great!

    Can I make the text bold?

    I edited the text, but how to make it bold?

    add_filter( ‘generate_post_date_output’, function( $output ) {
    echo $output;

    if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    echo ‘<span class=”comments-link”>’;
    comments_popup_link( __( ‘0 comment’, ‘generatepress’ ), __( ‘ Leave a Comment’, ‘generatepress’ ), __( ‘% Comments’, ‘generatepress’ ) );
    echo ‘</span>’;
    }
    } );

    #1028587
    Leo
    Staff
    Customer Support

    Edit this block of existing CSS:

    .tags-links a, .cat-links a {
        font-weight: 600;
    }

    to this:

    .tags-links a, .cat-links a, .comments-link a {
        font-weight: 600;
    }
    #1028590
    Carol

    You’re the Best!

    Thank you so much!

    πŸ™‚

    #1028838
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.