Archived topic
Help
9 replies · Started by Mr McMarry on June 6, 2018
##Deleted
Any reply ?
Hi there, you can try using the read more filter to add an additional link:
https://docs.generatepress.com/article/generate_excerpt_more_output/
Sorry i dont understand what to do
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>
Its not working ?
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' )
);
}
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
Nevermind i done it sorry for silly question please delete this topic Thank You
David And Tom you guys make my site possible
You're welcome - glad we could be of help