Title: Short Code isn&#039;t pulling links
Last modified: August 21, 2016

---

# Short Code isn't pulling links

 *  Resolved [angengland](https://wordpress.org/support/users/angengland/)
 * (@angengland)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/short-code-isnt-pulling-links/)
 * The links/buy buttons appear fine in the sidebar and on the main feature page
   [http://backyardfarmingguide.com/books/backyard-farming-on-an-acre-more-or-less/](http://backyardfarmingguide.com/books/backyard-farming-on-an-acre-more-or-less/)
 * However they fail to appear with the shortcode within this page where I will 
   be listing several books and wanted mine highlighted and featured.
    [http://backyardfarmingguide.com/the-reading-list/](http://backyardfarmingguide.com/the-reading-list/)
 * I used the shortcode [booklinks] and you can see that the wrapper bit appears
   but it’s not pulling the links/buttons.
 * Thoughts?
 * [http://wordpress.org/plugins/mybooks-for-authors/](http://wordpress.org/plugins/mybooks-for-authors/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Joseph Hinson](https://wordpress.org/support/users/jhinson/)
 * (@jhinson)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/short-code-isnt-pulling-links/#post-4041479)
 * Hi AngEngland,
 * The plugin doesn’t work that way at present. The [booklinks] shortcode only pulls
   in book links on the individual book pages, however, it’s a good idea.
 * If you use the code below and overwrite the contents of ot_book_shortcodes.php
   you can use the shortcode by passing a book ID like:
 * [booklinks id=”470″] (where 470 is the ID of the desired book).
 * Or you can hang tight and I’ll update it in the next version of the plugin.
 *     ```
       <?php
       // [booklinks text="hide" id="bookID"]
       function products_booklinks($atts) {
       	extract(shortcode_atts(array(
       		"text" => 'show',
       		"id" => ''
       	), $atts));
       	global $post;
       	if ($id) {
       		$theID = $id;
       	} else {
       		$theID = $post->ID;
       	}
       	$amazon = get_post_meta($theID, 'amazon_url', true);
       	$bn = get_post_meta($theID, 'bn_url', true);
       	$ceoread = get_post_meta($theID, 'ceoread_url', true);
       	$indie = get_post_meta($theID, 'indie_url', true);
       	$ibooks = get_post_meta($theID, 'ibooks_url', true);
       	$itunes = get_post_meta($theID, 'itunes_url', true);
       	$audible = get_post_meta($theID, 'audible_url', true);
       	$bam = get_post_meta($theID, 'bam_url', true);
       	$return = '';
       	if ($text != 'hide') {
       		$return .='<div class="order-book"><p class="booklinks"><span class="buy-book-text">Buy the book:<br /></span>';
       		$return .= ot_booklinks( $amazon, $bn, $ceoread, $ibooks, $indie, $itunes, $audible, $bam);
       		$return .='</p></div>';
       	} else {
       		$return .= ot_booklinks( $amazon, $bn, $ceoread, $ibooks, $indie, $itunes, $audible, $bam);
       	}
       	return $return;
       }
       add_shortcode("booklinks", "products_booklinks");
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Short Code isn't pulling links’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mybooks-for-authors.svg)
 * [MyBooks for Authors, by Out:think Group](https://wordpress.org/plugins/mybooks-for-authors/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mybooks-for-authors/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mybooks-for-authors/)
 * [Active Topics](https://wordpress.org/support/plugin/mybooks-for-authors/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mybooks-for-authors/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mybooks-for-authors/reviews/)

## Tags

 * [links](https://wordpress.org/support/topic-tag/links/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 1 reply
 * 2 participants
 * Last reply from: [Joseph Hinson](https://wordpress.org/support/users/jhinson/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/short-code-isnt-pulling-links/#post-4041479)
 * Status: resolved