free cake making cake decoration classes courses images foskaayfoods

Share:

NOTICE BOARD: 

99.9% QUESTIONS ALREADY HAVE WELL RESEARCHED ANSWERS

We do not allow copy and paste-like most forums are known for. Our posts are unique and all member must abide with this rule or get kicked out!!!

 

>>Click Here To Submit Sponsored Posts + Get DA60 Dofollow Backlinks<<

 

DAILY DEALS>>

(1) Successfully Relocate to Canada Guide || (2) Ultimate Paypal Guide + MAKE MONEY 2020 (5-in-1 Video Course) 

Foskaay Services: SEO, Web/Blog Design, Digital Marketing & also offer Training call/Whatsapp +234-7066-052228

How To Add Adsense Ads Within Post  

   RSS

0

This guide shows you how I add Adsense ads after the first paragraph of a blog post to convert better and you can decide by changing just a line which paragraph you want it to display.

I can help handle Web design, Digital Marketing, grow real followers on social media, whiteboard animation, crypto investments, blog and also offer TRAINING in all above mentioned and make money online guides.

1 Answer

free cake making cake decoration classes courses images foskaayfoods

0

One of the best converting place for AdSense ads in when placed in your content and one of such place is the first paragraph according to Rankxl.

So, follow these steps to implement the ads code automatically across all your blog posts.

1) Put the following in your function.php file:

 

function insert_ad_block( $text ) {

if ( is_single() ) :

$ads_text = 'PUT YOUR ADSENSE ADS CODE HERE';
$split_by = "\n";
$insert_after = 1; //number of paragraphs

// make array of paragraphs
$paragraphs = explode( $split_by, $text);

// if array elements are less than $insert_after set the insert point at the end
$len = count( $paragraphs );
if ( $len < $insert_after ) $insert_after = $len; // insert $ads_text into the array at the specified point
array_splice( $paragraphs, $insert_after, 0, $ads_text ); // loop through array and build string for output
foreach( $paragraphs as $paragraph ) { $new_text .= $paragraph; } return $new_text; endif; return $text; }

add_filter('the_content', 'insert_ad_block');

 

 

2) Save the function.php file

3) Visit any of your posts and refresh it. It should display now if done correctly

NOTE: You can edit the "1" and change to 2 or 3 or whatever paragraph number you want.

It works fine for me if you click on this page About Foskaay Forum but not working on the forum because it does not use default wp posting so the function.php file does not impact it.

This post was modified 4 months ago by oskaaay

I can help handle Web design, Digital Marketing, grow real followers on social media, whiteboard animation, crypto investments, blog and also offer TRAINING in all above mentioned and make money online guides.

Share: