What the Google girl told me – Video tutorial Part 2 (with closed captions)


Post Views for Sep :
andy
I am the creator of CommentLuv Premium
andy
andy
You can get your own content published on this site as long as you have CommentLuv installed on your site.

Doing so means you get exposure to thousands and thousands of other CommentLuv users and your posts get sent out to the massive subscriber list.

Google loves this site and indexes it multiple times per day and posts always get lots of comments so you can be sure of some excellent exposure.

See the Write For Us page for more details

btw.. you can get this author box here

This is the second tutorial in the series showing how I did the things that the girl from Google told me on our consultation session.

In this tutorial, you will learn how to add an inline adsense block to your post content just like it does on the posts on comluv.com

[youtube]http://www.youtube.com/watch?v=woVcLdIvfeI[/youtube]

To see the subtitles, start playing the video, click the arrow on the video toolbar and then click the red CC

Here is the code that was used in the video

add_filter('the_content', 'my_inline_adsense');

function my_inline_adsense($content){
    if(is_singular()){
        $firstendh2 = stripos($content,'</h2>');
        $firstendh2 += 5;
        $secondendh2 = stripos($content,'</h2>',$firstendh2);
        $secondendh2 += 5;
        
        $startpost = substr($content,0,$secondendh2);
$endpost = substr($content,$secondendh2); $divstart = '<div style="margin-right: 5px; margin-bottom: 5px; float: left;">'; $divend = '</div>'; $adsense = '<script type="text/javascript"><!-- google_ad_client = "ca-pub-4655222703200811"; /* inline with post */ google_ad_slot = "2605694935"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; $content = $startpost . $divstart . $adsense . $divend . $endpost; } return $content; }

If you have any questions or feedback, feel free to leave them in the comments.