Title: shortcode suggestions/custom coding questions
Last modified: August 31, 2016

---

# shortcode suggestions/custom coding questions

 *  Resolved [Gretchen Louise](https://wordpress.org/support/users/gretchenlouise/)
 * (@gretchenlouise)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/shortcode-suggestionscustom-coding-questions/)
 * I’d love to make some suggestions for shortcode developments. Right now, I’m 
   trying to code them myself (using the Views plugin by WP-Types), but to no avail.
 * Here’s the thing: I don’t need a full-fledged bookstore on my site. But we are
   constantly recommending books, changing out the book covers in the sidebar that
   link straight to Amazon, and otherwise using book covers as Amazon ads throughout
   our site.
 * My thought is that MyBookTable would make this so much easier. I’d love to be
   able to use a shortcode or widget to display specific or random book covers based
   on a certain tag, author, etc. BUT I want those book covers to link directly 
   to Amazon. The shadow box and buy buttons seem like they are less likely to get
   clicked in on a sidebar ad than just a book image.
 * I’d love to see shortcode/widget options for quantity of books and choosing order
   of books. i.e. 2 random books from the tag “stories”:
    `[mybooktable tag="stories"
   quantity="2" orderby="random"]`
 * So far, I’ve gotten this far in Views. I have a View with this code:
 *     ```
       <wpv-loop>
       		<a href="http://www.amazon.com/dp/[wpv-post-field name="mbt_unique_id_asin"]?tag=myaffiliateid-20">
       <img src="[wpv-post-field name="mbt_book_image_id"]" alt="[wpv-post-title]"></a>
       	</wpv-loop>
       ```
   
 * And it outputs this:
    `<a href="http://www.amazon.com/dp/084231833X?tag=myaffiliateid-
   20"><img src="35915" alt="My Book's Title"></a>`
 * Obviously, the image id is not the image URL. And there are no custom fields 
   visible to Views that show the image URL. I’ve peeked around in the functions,
   but I can’t use PHP in Views and so that gets beyond me.
 * Any tips for an easy way to do this? Or hope that you’ll soon have features that
   would allow us to specify where the grid view/book covers link to?
 * Thanks for any input!
 * [https://wordpress.org/plugins/mybooktable/](https://wordpress.org/plugins/mybooktable/)

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

 *  Thread Starter [Gretchen Louise](https://wordpress.org/support/users/gretchenlouise/)
 * (@gretchenlouise)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/shortcode-suggestionscustom-coding-questions/#post-7055598)
 * Sorry for the double post!
 *  Plugin Author [zookatron](https://wordpress.org/support/users/zookatron/)
 * (@zookatron)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/shortcode-suggestionscustom-coding-questions/#post-7055687)
 * Unfortunately I can’t delete this post myself, but I have marked it as resolved.
 * Users should refer to the canonical support post here: [https://wordpress.org/support/topic/suggestions-for-shortcode-options](https://wordpress.org/support/topic/suggestions-for-shortcode-options)

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

The topic ‘shortcode suggestions/custom coding questions’ is closed to new replies.

 * ![](https://ps.w.org/mybooktable/assets/icon-256x256.jpg?rev=1083550)
 * [MyBookTable Bookstore by Stormhill Media](https://wordpress.org/plugins/mybooktable/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mybooktable/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mybooktable/)
 * [Active Topics](https://wordpress.org/support/plugin/mybooktable/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mybooktable/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mybooktable/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [zookatron](https://wordpress.org/support/users/zookatron/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/shortcode-suggestionscustom-coding-questions/#post-7055687)
 * Status: resolved