Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #7980

    So my main goal is to implement google ads between the 2nd and 3rd post on the home page. Ive seen it done on lots of websites and if looked at a lot of tutorials too. All of the tutorials have to do with codes like <?php $count = 1; ?> in the index.php But i cant find <?php $count = 1; ?> any were. So if you could, could you please help me achieving my goal? =]

    this is one of the tutorials i have tried that didn’t help http://www.lancelhoff.com/adding-adsense-ads-between-posts/

    #59922
    #59923

    Thanks alot dude i know this will work but which file am editing? and maybe where?

    #59924

    ok i know in the index but where to i put that line of code. sorry i just cant figure it out

    #59925

    You need to place the code somewhere inside the loop. I.e. replace:

    </div><!--end entry -->
    <?php
    $fullsized--;

    with:

    </div><!--end entry -->
    <?php
    if ( $fullsized == 1 ) { my banner code here }
    $fullsized--;

    and adjust the counter variable & the banner code as required.

    #59926

    I get

    Parse error: syntax error, unexpected ‘<‘ in /home/content/46/8527246/html/wp-content/themes/newscast/index.php on line 169

    =[

    #59927

    If you want to insert html code you need to put ?> before it and <?php after it. Otherwise the server tries to interpret it as php code and outputs errors.

    #59928

    ok thanks alot ill give it a try

    #59929

    Thank you so much, i finally got it to work like i wanted to. You guys are awesome. Do you have a donate button or something. All your help is definitely worth some money.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Help adding widgets/ads in between post on home page’ is closed to new replies.