Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

Home Forums Support Help

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #592888
    Mr McMarry

    ##Deleted

    #593229
    Mr McMarry

    Any reply ?

    #593267
    David
    Staff
    Customer Support

    Hi there, you can try using the read more filter to add an additional link:

    https://docs.generatepress.com/article/generate_excerpt_more_output/

    #593281
    Mr McMarry

    Sorry i dont understand what to do

    #593518
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can add the button like this:

    add_filter( 'generate_content_more_link_output', 'tu_add_additional_excerpt_button' );
    function tu_add_additional_excerpt_button( $button ) {
        return sprintf(
            '...<p class="read-more-container">
                <a title="%1$s" class="button read-more content-read-more" href="%2$s">%3$s</a>
                <a class="button download-more" href="%4$s">Download</a>
            </p>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ),
            __( 'Read more', 'generatepress' ),
            esc_url( get_permalink( get_the_ID() ) . '#download' )
        );
    }

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

    Now on your single post, you’ll need to add your download button into a div like this:

    <div id="download">
        Download button in here
    </div>
    #593777
    Mr McMarry

    Its not working ?

    #593837
    David
    Staff
    Customer Support

    Try this:

    add_filter( 'generate_excerpt_more_output', 'tu_add_additional_excerpt_button' );
    function tu_add_additional_excerpt_button( $button ) {
        return sprintf(
            '<p class="read-more-container">
                <a title="%1$s" class="button read-more content-read-more" href="%2$s">%3$s</a>
                <a class="button download-more" href="%4$s">Download</a>
            </p>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ),
            __( 'Read more', 'generatepress' ),
            esc_url( get_permalink( get_the_ID() ) . '#download' )
        );
    }
    #593878
    Mr McMarry

    Now its working but not in a line with a br between them can we fix that and please after this customization is done please delete this topic please thank you

    #593883
    Mr McMarry

    Nevermind i done it sorry for silly question please delete this topic Thank You

    David And Tom you guys make my site possible

    #593886
    David
    Staff
    Customer Support

    You’re welcome – glad we could be of help

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