ads.jpg

Can we place adsense ads in the middle of the post ( single post ) like photo above ?

yes, we can do it and this is very easy because you only need to costumize your single.php file . This trick only work at single post or page or other template that showed full content.

1. open template single post (single.php)

2. find this code below

    < ?php the_content(); ?>
    change with this code :
    < ?php

    $where = 2;

    $content = apply_filters('the_content', get_the_content());

    $content = explode("

    ", $content);

    for ($i = 0; $i

    if ($i == $where) { ?>

    //ADS Code

    < ?php

    }

    echo $content[$i] . "

    ";

    }

    ?>

    note :
    second line  ($where = 2;)  variable that showed which paragraf  ads will appear. And please remember that  index php start from  0 so $where = 2; that mean  after first paragraf ads will appear.
    you also can modified ads position
    right :
    1. style=“float:right; margin:0 0 10px 10px;”>

    2. //ads code
    if left you only change it with float : left
    center :
    1. style=“text-align:center; margin:10px 0;”>

    2. //ads code
    hope this trick helfpul and make your adsense ctr increase..
    viva wordpress! :D