First thumbnail request in sidebar wants to call a header path
-
i’m just a little confused at the moment over why one of my code snippets always wants to call a header when I want to call a thumbnail.
It only happens in the product categories of wp ecommerce for normal posts categories the thumbnail displays no problem.
It only happens in the first thumbnail call. I use basically the same code in three different widgets to call the latest product, best seller and special offer.
If I have the latest product widget as the first widget then the other two thumbnails display ok but the thumbnail does not display in the latest product and the image path is: images/headers/path.jpg
If swap the best seller or special offer widget with the latest product then then its thumbnail displays ok and the one I swap fails to display and the image path is changed.
An example page is: https://phonelingo.co.uk/products-page/smartphones/
The code snippet I am using is:
<?php global $post; $args = array( 'post_type' => 'wpsc-product','numberposts' => 1, 'orderby' => 'rand', 'wpsc_product_category'=>'best-sellers' ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <div id="specoff"> <ul> <li><div id="specoffthumb"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( array(180,150)); ?></div><div id="specofftitle"> <?php the_title(); ?></a></div> <div id="specofforigprice"><?php _e('Price', 'wpsc'); ?>: <span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="currentprice pricedisplay"><?php echo wpsc_product_normal_price(); ?></span></div> </li> </ul></div> <?php endforeach; ?>
The code is basically the same but with different category id calls.
I can live with the dead image call but I am confused as to why it should only happen to the first widget when the other work ok.
Thanks
Kevin
- The topic ‘First thumbnail request in sidebar wants to call a header path’ is closed to new replies.