Support » Plugin: Amazon Product in a Post Plugin » amazon-product-table has inconsistent divs and classes

  • Resolved jhoffman255


    Liking this plugin so far, though styling it has been a bit of a challenge. Using [AMAZONPRODUCTS…] vs [amazon-elements…] because, oddly, they don’t return the same images! Within your ‘amazon-product-table’ you have divs with classes for each section (helpful) until the div enclosing the ‘amazon-product-price’ table, which is enclosed in a div with no class and deprecated ‘align=”left”‘ declaration.

    First request: Please remove the alignment declaration and give that enclosing div a class.

    Second request: Take the ‘amazon-dates’ div out of that table so that we can size and position it independently of the price grid.


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Don Fischer


    Thanks for the feedback.
    Just a little background:

    1. The basic table structure has been in place since the initial plugin was built (which was quite some time before it was released to the WP Repository). The layout worked well for a long time, but we realized it getting way out of date and changed the layout in the amazon-elements shortcode (the new shortcode) in the last release but did not get the updated layout in the old shortcode or post layout at that time. It will be updated soon, we promise. The plugin was never initially intended for mass usage and was built for one specific client at the time. The huge number of emails we received asking us how we were doing it, spawned the quick release of the first release of the plugin. In hind site, I wish I had spent a little more time and set it up with divs – but then again, the quality of the themes was not as good back then and the table layout was more universally stable to the mass of themes at the time.
    2. The second request will follow when we update the layout of the other items.

    We also plan to implement a layout helper in the near future, to help with styling and layout – and make it a bit more flexible.

    Again, thanks for the feedback.
    Warm regards,

    Thanks, Don. I will add that this is a great plug-in and I’m glad you released it! I would have rather used the new [amazon-element] shortcode as it does provide all the flexibility for formatting that I need except for the weird issue where Amazon returns a different image set (different URLs and images for some products) when you use the old [AMAZONPRODUCTS…] shortcode.

    Looking forward to the update and keep up the good work.


    Plugin Author Don Fischer


    Thanks for the compliments.
    If you want to use the new shortcode and the old image format, you can do it by adding some code to your functions.php file after the<?php opening tag:

    add_filter('amazon_product_in_a_post_plugin_elements_filter', 'fix_amazon_image',1);
    function fix_amazon_image($attr){
            global $apippnewwindowhtml;
            foreach($attr as $key => $product){
                        $attr[$key]['MediumImage'] = '<a href="'.$product['URL'].'" '.$apippnewwindowhtml.'><img src="'.$product['MediumImage'].'" class="amazon-image" alt="" /></a>';
                        $attr[$key]['MediumImage'] = '<img src="'.$product['MediumImage'].'" class="amazon-image" alt="" />';
        return $attr;

    Then when you use the amazon-elements shortcode, use MediumImage for the image field, like so:

    [amazon-elements asin="0753515032" fields="title,MediumImage,URL,large-image-link,button"]

    That should solve the problem for you. Basically what it does is filter the new image and then call the old image function to get the correct image the old way it was done (which will stay in the plugin, so no worries about future use).
    Warm regards,

    This is perfect! Thank you. Thank you. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘amazon-product-table has inconsistent divs and classes’ is closed to new replies.