HOW TO ADD ADSENSE IN WOOCOMMERCE

HOW TO ADD ADSENSE IN WOOCOMMERCE

How to add adsense into woocomerce single product page

This post will show you how to add adsense into all woocommerce single product pages automatically without a plugin
I have search the internet for technics on how to add adsense into woocommerce, but I could not find any meaningful guide or plugin on this.

I did carry out research and below is the positive outcome that will help you add adsense to woocomerce single product page, woocommerce short description area and the woocommerce long description area.

TO ADD ADSENSE INTO THE WOOCOMMERCE PRODUCT SHORT DESCRIPTION AREA

login into your cpanel and follow the below path
public_html/wp-content/plugins/woocommerce/templates/single-product

in the single-product folder right-click and select edit on the woocommerce “short-description.php”

add your adsense code immediately under
if ( ! $post->post_excerpt ) {
return;
}

?>
<div class=”woocommerce-product-details__short-description”>
<?php echo apply_filters( ‘woocommerce_short_description’, $post->post_excerpt ); ?>
</div>
ADSENSE CODE HERE

This allows the adsense code to be automatically added before the add to cart of every woocommerce single product page

 

TO ADD ADSENSE INTO THE WOOCOMMERCE PRODUCT DESCRIPTION

Visit public_html/wp-content/plugins/woocommerce/templates/single-product/tabs

Right-Click and select edit on the woocommerce “description.php”

If you want the ads to show below the title, add your adsense code immediately under
<?php if ( $heading ) : ?>
<h2><?php echo $heading; ?></h2>
<?php endif; ?>

But if you want your ads to show after the content, add your adsense code immediately under
<?php the_content(); ?>

Check Also

How to start accepting credit cards for my business

How to start accepting credit cards for my business

How to start accepting credit cards for my business Businesses need to be able to …