Support » Plugin: eShop » [Plugin: eShop] Alternative to using the WordPress Featured Image?

  • I now understand that to get thumbnails to show up in eshop, you must set the featured image through the “Set Featured Image” function for each post. I’m working on finding a way to automate the process of setting a featured image for each post manually. I have many posts being generated automatically by cronjob (with prices, and an image URL), and then the corresponding images are uploaded separately. I’d like to be able to insert the image URL into a custom field, or in the wp_post_meta table in some way, so that wordpress and eshop know that the URL in this field is the featured image that should be used for the thumbnails. The image is hosted on my server, but I’m looking to avoid manually uploading it for each item. Is there any way to do this, you think?

    If not, would it be possible for me to modify eshop so that instead of looking for the thumbnail as the WordPress featured image, it would look to Get The Image (Justin Tadlock’s plugin), TimThumb (which is already used by the eStore theme I’m using), or another automatic thumbnail generator? Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author elfin


    in 3.1 you would be able to use: set_post_thumbnail to automatically set it.

    But have a look at the function get_the_post_thumbnail and specifically the filter post_thumbnail_html, which might be useful.

    Hey Rich, thanks for the feedback! Here’s what I’m trying to do, and I’ve tried to modify the eshop-base.php files, etc. I want to replace the calls for the featured thumbnail, everywhere eshop is looking for the post thumbnail, i want it to use this snippet of code instead:

    global $wp_query;
    $postid = $wp_query->post->ID;
    echo get_post_meta($postid, 'Thumbnail', true);

    That will grab the custom field (which has the thumbnail URL) and put it in the Google Base XML. If I could only modify the files correctly! Any tips?


    Plugin Author elfin


    eshop-base-feed.php ?

    Ok, got it! So, here are instructions to add a custom field value to the eShop Google base feed: (I’ll be using it to add an image link, and to add a different brand for each item)

    1. Open eshop-base-feed.php.

    2. Up top somewhere, add this code:

    global $wp_query;
    $postid = $wp_query->post->ID;
    $imagelinkcustom = get_post_meta($postid, 'Thumbnail', true);

    It defines the variable $imagelinkcustom from the custom field “Thumbnail”. Replace “Thumbnail” with the name of the custom field you want to grab.

    3. Replace lines 107-111 with this:


    The key part of the above code is this line:


    But it’s a little tricky to get the apostrophes right, so you can just paste the whole thing. 🙂

    Nevermind! The code doesn’t quite work. It does not cycle through all the wordpress posts, it just used the custom field value from the first post. I guess you’d have to do a for each scenario on it? I’m not sure how eshop-base-feed.php loops through the products. Rich, would you have any suggestions? This is what I have now for defining the variables $imagelink and $brand. I guess it’s not a constant variable, it needs to be an array of products, but I can’t figure out how to insert this whole mess inside the<item> template you’ve laid out.

    global $wp_query;
    $postid = $wp_query->post->ID;
    $imagelink = get_post_meta($postid, 'Thumbnail', true);
    global $wp_query;
    $postid = $wp_query->post->ID;
    $brand = get_post_meta($postid, 'brand', true);
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: eShop] Alternative to using the WordPress Featured Image?’ is closed to new replies.