Title: Adding 2nd Button Alongside Read More
Last modified: December 7, 2018

---

# Adding 2nd Button Alongside Read More

 *  Resolved [JoeVenables](https://wordpress.org/support/users/joevenables/)
 * (@joevenables)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/adding-2nd-button-alongside-read-more/)
 * Hello,
 * I am working on a site for an author, using GeneratePress Premium. I am intending
   to use WP Show Posts to display a List of all their published works. The List
   will show an excerpt with a Read More button.
 * Alongside the Read More button I would like to display a Buy Book button, which
   will link to an external site.
 * My idea for how to do this is to use a Custom Field, buy-book, for which the 
   value is the external URL. I think I could display this using the method here:
   [https://wpshowposts.com/support/topic/output-custom-field-in-div-class/](https://wpshowposts.com/support/topic/output-custom-field-in-div-class/)
 * I have three questions:
 * Do you think that method would work for what I am trying to achieve?
    Do I need
   the Pro version of the plugin to use that method? How exactly do I go about hooking
   the code into the plugin; where do I need to paste the code?
 * (Please excuse my ignorance on the last question, I am not experienced with PHP).
 * Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/adding-2nd-button-alongside-read-more/#post-10961130)
 * Hi there,
 * You should be able to use a filter for that.
 * Something like this:
 *     ```
       add_filter( 'wpsp_read_more_output', function( $output ) {
           $buy_book = get_post_meta( get_the_ID(), '_buy_book_field', true );
           $buy_book_button = '';
   
           if ( $buy_book ) {
               $buy_book_button = '<a class="buy-book" href="' . $buy_book . '">Buy Book</a>';
           }
   
           echo $output . $buy_book_button;
       } );
       ```
   
 * Let me know if you need more info 🙂
 *  Thread Starter [JoeVenables](https://wordpress.org/support/users/joevenables/)
 * (@joevenables)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/adding-2nd-button-alongside-read-more/#post-10974659)
 * Great, thanks Tom!
 *  Plugin Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/adding-2nd-button-alongside-read-more/#post-10976579)
 * You’re welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding 2nd Button Alongside Read More’ is closed to new replies.

 * ![](https://ps.w.org/wp-show-posts/assets/icon-256x256.png?rev=2846296)
 * [WP Show Posts](https://wordpress.org/plugins/wp-show-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-show-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-show-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-show-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-show-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-show-posts/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [pre-sale](https://wordpress.org/support/topic-tag/pre-sale/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tom](https://wordpress.org/support/users/edge22/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/adding-2nd-button-alongside-read-more/#post-10976579)
 * Status: resolved