When you create a blog in WordPress first thing in your mind is earning.And believe me there are a couple of ways to earn money from your blog.Popular and good way to earn money is Google absence.You can display advertisements from google on your blog.
Most beginners wonder whether these sites insert ads manually when they write the content, or if there is a special code for this.Often when beginners want to include ads in their post,They add any plugin for this.But do you know you can add ads code without using plugin.But I don’t like to install plugins for small issues like inserting ads within your WordPress post content. Installing plugins for little things may effect your website’s speed. Lesser the plugins = faster the speed. You can use maximum 15-20 WordPress plugin for an average site speed.
Do you want to insert your absence code into the blog post? If so, this post will help you to add ads between the post content in WordPress without using any plugin.Not only ads you can display anything within the post content with the help of this.Using add_filter() function in WordPress, we can easily modify the post content before rendering it.
Open the functions.php file of your current theme and paste the following code.

/*
 * Insert ads data into post content
 * $adsdata -Specify data that wants to add
 * $insertAfter -Specify paragraph number
 */
add_filter('the_content', 'cb_insert_ads');
function cb_insert_ads($content){
    if(is_single()){
        //ads data
        $adsdata = '<div>Your Ads data</div>';
        
        //insert after paragraph number
        $insertAfter = 2;
        
        $closingP = '</p>';
        $contentdata = explode($closingP, $content);
        foreach($contentdata as $key => $con){
            if(trim($con)) {
                $contentdata[$key] .= $closingP;
            }
            if(($key + 1) == $insertAfter){ 
                $contentdata[$key] .= $adsdata;
            }
        }
        $content = implode('', $contentdata);
    }
    return $content;    
}
http://codingbin.com/wp-content/uploads/2017/09/Insert-Ads-into-Post-Content.pnghttp://codingbin.com/wp-content/uploads/2017/09/Insert-Ads-into-Post-Content-150x150.pngManoj DhimanphpWordPressWhen you create a blog in WordPress first thing in your mind is earning.And believe me there are a couple of ways to earn money from your blog.Popular and good way to earn money is Google absence.You can display advertisements from google on your blog. Most beginners wonder whether...coding, php, wordpress, yii, cakephp, and  jquery

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request