1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

Bikin ads antara post di wordpress

Discussion in 'Wordpress' started by aaheroe, Jun 29, 2006.

  1. aaheroe

    aaheroe Super Hero

    Joined:
    Sep 2, 2005
    Messages:
    940
    Likes Received:
    175
    Location:
    BENCOLEN
    bantuin dong.. da cari2 d nih forum tp ga nemu2.. euy..

    tolong bantuin cariin yah, da pernah d post ma cosa.. tp ga tau dimana heheeue..

    thx
     
  2. just4fun

    just4fun Super Hero

    Joined:
    Mar 21, 2006
    Messages:
    1,339
    Likes Received:
    55
    Location:
    ████████
    om cosa mana nih :)
     
  3. yulia

    yulia Super Hero

    Joined:
    Sep 22, 2005
    Messages:
    903
    Likes Received:
    63
    Bbrapa postingan om coz ada yg ilang, mungkin kemaren pas gempa ikut kececer

    Untuk masukin ads ditengah postingan di halaman index WP, langsung aja ya...

    Sebelum looping diletakin :

    Code:
    <?php $i = 1 ?>
    <?php if (have_posts()) { while (have_posts()) { the_post(); ?>
    <?php $i ++ ?>
    
    Kemudian pada akhir postingan, biasanya letaknya diatas php comments_template, dicantolin :

    Code:
    <?php if($i == N){ ?>
    <!-- Begin Google Adsense code -->
    <script type="text/javascript"><!--
    google_ad_client = "pub-xxxx";
    dst....
    <script type="text/javascript" src="[url]http://pagead2.googlesyndication.com/pagead/show_ads.js">[/url]
    </script>
    <!-- End Google Adsense code -->
    <?php } ?>
    N diatas adalah jumlah posting yg akan diantarai oleh si ads
     
  4. kalau pake cara ini
    ads akan tampil di antara posting sebanyak 3 buah
    jadi kalau masang ads di sidebar biasanya ads tersebut tidak akan tampil :(
    CMIIW

    salam
     
  5. yulia

    yulia Super Hero

    Joined:
    Sep 22, 2005
    Messages:
    903
    Likes Received:
    63
    3 buah? Variabel yg nulis 3 yg mana coba hehehe...
     
  6. bukannya itu utk bikin ads unit tampil di antara psotingan kan....
    berarti akan tampil di tiap dan di antara postingan
    artinya ads unit cuma bis atmapil sebanyak 3
    benar gak sih...hehehehehehe :D
    kan..tadi dibawahnya ada CMIIW :p

    salam
     
  7. Ya ndak dunk yang di kasih yulia kan ada fungsi if nya dan nilai N itu menandakan post ke berapa maksudnya gini

    jika nilai n = 3 maka jika i = 3 tampil ads selain itu ya ndak tampil. Cermati lagi sourcenya. Maaf jika salah wong ndah tau PHP kekekekek :D
     
  8. aaheroe

    aaheroe Super Hero

    Joined:
    Sep 2, 2005
    Messages:
    940
    Likes Received:
    175
    Location:
    BENCOLEN
    dah coba tuh.. caranya mbak yul

    tapi ttp gak bisa..

    bantuing dong..
     
  9. aaheroe

    aaheroe Super Hero

    Joined:
    Sep 2, 2005
    Messages:
    940
    Likes Received:
    175
    Location:
    BENCOLEN
  10. marbolec

    marbolec Super Hero

    Joined:
    May 19, 2007
    Messages:
    841
    Likes Received:
    13
    Location:
    Jogjaa!
  11. risma2006

    risma2006 Ads.id Fan

    Joined:
    Oct 16, 2007
    Messages:
    147
    Likes Received:
    1
    Location:
    Away from home
    Berlaku buat weblog nya wordpress gak

    Code2 nya berlaku buat weblog nya wordpress gak ... aku udah coba pasang iklan di sana tp g nampil di risma2006.wordpress.com :banghead:
     
  12. risma2006

    risma2006 Ads.id Fan

    Joined:
    Oct 16, 2007
    Messages:
    147
    Likes Received:
    1
    Location:
    Away from home
    Berlaku buat weblog nya wordpress gak

    Code2 nya berlaku buat weblog nya wordpress gak ... aku udah coba pasang iklan di sana tp g nampil di risma2006.wordpress.com :banghead:
     
  13. lolak

    lolak Guest

    hehehheee.... blog di wordpress.com sepertinya belum bisa dipasangin adsense dan program2 yang lainnya.
     

Share This Page