suggestions for shortcode options
-
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!
The topic ‘suggestions for shortcode options’ is closed to new replies.