Image in woocommerce product page via hook
Budget: $30 – $250 AUD
## NO SITE ACCESS PROVIDED ##
I have this code in functions.php that doesn't seem to work:
function insert_content( $post_excerpt ) {
$content = '<a href="/highest-quality-super-foods/" target="_blank"><img src="' . site_url() . '/wp-content/uploads/2020/09/aco-google-shopping.png" width="100px" style="float:right;" class="aco-product"></a>';
return $content.'<br>'.$post_excerpt; }
add_filter('woocommerce_after_add_to_cart_form', 'insert_content', 10, 1);
If I change the location to
function insert_content( $post_excerpt ) {
$content = '<a href="/highest-quality-super-foods/" target="_blank"><img src="' . site_url() . '/wp-content/uploads/2020/09/aco-google-shopping.png" width="100px" style="float:right;" class="aco-product"></a>';
return $content.'<br>'.$post_excerpt; }
add_filter('woocommerce_short_description', 'insert_content', 10, 1);
Then it shows up in TWO locations (attached screenshot)
Please tell me how to fix my code so it just shows up ONCE after add to cart form
Thanks
I have this code in functions.php that doesn't seem to work:
function insert_content( $post_excerpt ) {
$content = '<a href="/highest-quality-super-foods/" target="_blank"><img src="' . site_url() . '/wp-content/uploads/2020/09/aco-google-shopping.png" width="100px" style="float:right;" class="aco-product"></a>';
return $content.'<br>'.$post_excerpt; }
add_filter('woocommerce_after_add_to_cart_form', 'insert_content', 10, 1);
If I change the location to
function insert_content( $post_excerpt ) {
$content = '<a href="/highest-quality-super-foods/" target="_blank"><img src="' . site_url() . '/wp-content/uploads/2020/09/aco-google-shopping.png" width="100px" style="float:right;" class="aco-product"></a>';
return $content.'<br>'.$post_excerpt; }
add_filter('woocommerce_short_description', 'insert_content', 10, 1);
Then it shows up in TWO locations (attached screenshot)
Please tell me how to fix my code so it just shows up ONCE after add to cart form
Thanks