This week I found the anomaly on my being created blog. That blog using free version of WP e-commerce plugin to handle our business on sale and purchase of our products. I’m having an issue on the category and products page. The custom image header of my blog is duplicating. The header shows twice. Sure, I have upgraded both WordPress and WP e-commerce to the latest versions but the anomaly is still not resolved in this way
Finally I had to flip through the files of the WP e-commerce plugin and read and pay attention to every functions that exists in those files. Finally, I found what I was looking for after a few days to check the files. I found a command that calls the header in a function that is used by WP e-commerce
We can found that function in the file theme.functions.php (wp-content/plugins/wp-e-commerce/wpsc-includes). The exact function name was wpsc_the_featured_image_fix. To be more clear, please refer to the comparison code below
Original function in WP E-commerce Version 3.8.4
function wpsc_the_featured_image_fix($stuff){
global $wp_query;
remove_action('post_thumbnail_html','wpsc_the_featured_image_fix');
if(isset($wp_query->query_vars['wpsc-product'])){
$stuff =''; ?>
<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> <?php
}
return $stuff;
}
add_action('post_thumbnail_html','wpsc_the_featured_image_fix');
Modified function to solve duplicate header on WP E-commerce used by our blog
function wpsc_the_featured_image_fix($stuff){
global $wp_query;
remove_action('post_thumbnail_html','wpsc_the_featured_image_fix');
if(isset($wp_query->query_vars['wpsc-product'])){
$stuff =''; ?>
<!-- <img src="<?php //header_image(); ?>" width="<?php //echo HEADER_IMAGE_WIDTH; ?>" height="<?php //echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> --><?php
}
return $stuff;
}
add_action('post_thumbnail_html','wpsc_the_featured_image_fix');
This is not really the best way to solve duplicate header on WP E-commerce. But this way has managed to speed up my work in building a new blog using WP E-commerce. Hopefully this way can be useful for you. If you have a better way, please comment here
This post was published 11 months 18 days ago which may make its no longer appropriate to current circumstances, this post may even be damaged or corrupted. This site is not responsible for any misunderstanding. Please contact us to notify the damage of this content if you find this content corrupted/missing/broken.
Related posts:
- How to Sort Post by Gd Star Rating
- How to Get Posts in Category
- How to Reduce High CPU Usage
- [Solved] Broken Link Checker Version 0.9.6 Installation Failed
- How to Insert YouTube iFrame Code in WordPress



{ 8 comments… read them below or add one }
I'm happy if this post can provide the solution for your problem
Thanks for your link
Thanks for sharing the info ,Good one .
My recent post VisualBee – Free and Best Microsoft PowerPoint Plugin
Thanks you very much you stop my tear great!!!!!!
Great sharing
Thanks man, got the problem fixed.
Thanks, this has saved me hours! The line has moved again!
I'm using version 3.8.7.4 and it's on line 1476.
God bless you for your sharing
Thank you, this worked like a charm!
I had the same problem and found a solution just using the dashboard:
1. Click on Products located in your Dashboard
2. Open your product listing
3. Remove Featured Image (menu on the left)
Hope that helps.