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

Cara Menampilkan Adsense pada halaman tertentu (specific posts/pages) di Wordpress

Discussion in 'Bengkel AdSense' started by MasDhani, Dec 4, 2010.

  1. MasDhani

    MasDhani PR9 Authority Sites

    Joined:
    Sep 29, 2009
    Messages:
    3,077
    Likes Received:
    737
    Location:
    Konoha Gakure
    Gak usah ane terjemahin.. ente dah pasti ngerti:

    You can open your current wordpress theme and make changes to single.php, category.php accordingly where you want the adsense to appear..

    To show only in single posts you have to first check using is_single() function and put the adsense code inside it. similary is_category() for categories.

    For example the below will show your adsense code only in all single post pages.

    Code:
    <?php if  (is_single()) { ?>
     
    [COLOR="red"]..........................
    Adsense code here
    ..........................[/COLOR]
     
    <?php } ?>
    
    If you specify a number is_single(’15′) it means that the code will show your adsense code only the post ID is 15.

    Similarly goes for

    * is_category() – To show in category pages
    * is_page() — To show in a wordpress page.
    * is_home() — To show only in homepage.


    Another example if you want to show your adsense code in both homepage and single posts, you can use this code.
    Code:
    	
    [/php]
     
    <pre><?php
    if (is_home() || is_single()) { ?>
    [COLOR="red"]------------ Adsense code ------------[/COLOR]
    <?php } else { ?>
    [COLOR="red"]----------Adsense code ----------[/COLOR]
    <?php } ?>
    </pre>
    
    
     
    deden, blogywalker, uptoyou and 2 others like this.
  2. Bertuah

    Bertuah Super Hero

    Joined:
    Jul 17, 2010
    Messages:
    981
    Likes Received:
    50
    Location:
    Pekanbaru, Riau
    Re: Cara Menampilkan Adsense pada halaman tertentu (specific posts/pages) di Wordpres

    thanks om.... langsung praktek.... ane kasih jempol.... :kembang:
     
  3. uptoyou

    uptoyou Ads.id Fan

    Joined:
    Apr 22, 2010
    Messages:
    222
    Likes Received:
    0
    Location:
    bdg-suburb
    Re: Cara Menampilkan Adsense pada halaman tertentu (specific posts/pages) di Wordpres

    buat di sidebar cocoknya ya kang?
     
  4. MasDhani

    MasDhani PR9 Authority Sites

    Joined:
    Sep 29, 2009
    Messages:
    3,077
    Likes Received:
    737
    Location:
    Konoha Gakure
    Re: Cara Menampilkan Adsense pada halaman tertentu (specific posts/pages) di Wordpres

    kalo sidebar.php berarti pake is_sidebar()

    Klo cuma maen di sidebar gampang pake aja plugin widget context
     
  5. dandyr

    dandyr Super Hero

    Joined:
    Oct 19, 2010
    Messages:
    4,472
    Likes Received:
    117
    Location:
    Don't Judge a Book by Its Cover
    Re: Cara Menampilkan Adsense pada halaman tertentu (specific posts/pages) di Wordpres

    Ane pake ini mas bro.. gak ngerti utak-atik php :swt2:
     
  6. lianp

    lianp Newbie

    Joined:
    May 30, 2011
    Messages:
    14
    Likes Received:
    0
    Re: Cara Menampilkan Adsense pada halaman tertentu (specific posts/pages) di Wordpres

    cara pasang iklan di sidebar kanan di blogger gimana ya caranya? sy coba masukkan script nya waktu di brows malah yang keluar kode nya langsung di layar bukan tampilan iklan nya (:|
     

Share This Page