WordPress.org

Ready to get started?Download WordPress

Forums

Google adsense with WP? (6 posts)

  1. Exploitx
    Member
    Posted 8 years ago #

    How can i add google adsense in the right side of the site? (with default theme)? what files should i edit and which code?

  2. Denis de Bernardy
    Member
    Posted 8 years ago #

    sidebar.php

  3. biznet
    Member
    Posted 8 years ago #

    I'm not a Technacal person but if this was spelled out what code to put where and where to place the adsence code it would be a real Blessing.

    Thanks,
    -Ken

  4. phonakins
    Member
    Posted 8 years ago #

    http://littlelioness.net/

    I'm using a "changed the colours" of the default theme - all I did was cut and paste the adsense code that I got from within the adsense site, and pasted it into my sidebar.php file (wp-content/themes/default/sidebar.php)

    um, if you really need it, here's mine (note there's alot of other useless crap in there you won't need!)

    <div id="sidebar">

    <ul>
    <li><script type="text/javascript"><!--
    google_ad_client = "pub-7641017530056984";
    google_ad_width = 125;
    google_ad_height = 125;
    google_ad_format = "125x125_as";
    google_ad_channel ="";
    google_color_border = "800080";
    google_color_bg = "FFF5F6";
    google_color_link = "800080";
    google_color_url = "FF6CFF";
    google_color_text = "6F6F6F";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></li>
    <li><h2><?php _e('About the Lioness'); ?></h2>
    Fiona; 22; Newcastle, Australia;
    <3 Rish; Speech Path student; <A href="http://littlelioness.net/index.php?p=169">100 things</a>; <?php get_post_count(); ?> Posts; <?php get_post_word_count(); ?> Words; <?php get_comment_count(); ?> Comments,
    msn: fiona@littlelioness.net</li>
    <li><h2><?php _e('Recent Banter:'); ?></h2>
    <?php get_recent_comments(10, 10, '', '', false); ?></li>
    <li><h2><?php _e('Blogroll:'); ?></h2>
    <script language="javascript" type="text/javascript" src="http://rpc.blogrolling.com/display.php?r=8c4684104ce1b2aeffce16990fbc65a6"></script>
    </li>
    <li><h2><?php _e('Hot Topics:'); ?></h2>
    <?php get_most_commented(5, '', '', true); ?></li>
    <li><h2><?php _e('Weather:'); ?></h2>
    <a href="http://weatherpixie.com/"><img src="http://weatherpixie.com/displayimg.php?place=YSCB&trooper=1&type=C" width=124 height=175 border=0 alt="The WeatherPixie"></a>(Canberra)
    </li>
    <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.

    <li><h2><?php _e('Author'); ?></h2>
    A little something about you, the author. Nothing lengthy, just an overview.
    </li>
    -->

    <li>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    You are currently browsing the archives for the <?php single_cat_title(''); ?> category.

    <?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for the day <?php the_time('l, F jS, Y'); ?>.

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for <?php the_time('F, Y'); ?>.

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for the year <?php the_time('Y'); ?>.

    <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
    You have searched the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for <strong>'<?php echo wp_specialchars($s); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.

    <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives.

    <?php } ?>
    </li>
    <?php wp_list_pages('title_li=<h2>' . __('Pages') . '</h2>' ); ?>

    <li><h2><?php _e('Archives'); ?></h2>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </li>
    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    <?php get_links_list(); ?>

    <li><h2><?php _e('Meta'); ?></h2>
    <ul>
    <?php wp_register(); ?>

    <li><?php wp_loginout(); ?></li>
    <li><a href="http://validator.w3.org/check/referer">"><?php _e('Valid XHTML'); ?></a></li>
    <li><a href="http://gmpg.org/xfn/">XFN</a></li>
    <li><a href="http://wordpress.org/">">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>
    </li>
    <li>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    </li>
    <li>
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHHgYJKoZIhvcNAQcEoIIHDzCCBwsCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBU9mDhxW62WWqpGUnPFhPdxYXOvE0XDQcuw6YR3oG7nTldRvifMbJBTr+LRechzPAlvRWzD85Hxmdv/6g7Eb+sYU/f5mLlGA1nr59VEi6de+28QBbFmFXTp8NUcLay8AIJdzfnYffc+1hf/VQTXu6P9+jQalTbuGpQTS09JhcYTDELMAkGBSsOAwIaBQAwgZsGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIGiZtho27X/6AeLQfkTn/GZ58RPNsJn6gERIHgrYnYtCEKG5t71UrSm1mMpWPqs3dKhZ2ym1OZJYRWmSuH02TJGJ6sBggiKTwnaz7Sc65Xy1R6xvWPwUfeVU1PIkDZylLpoxOpJI8h0GJQWHxsWj6hhwnSc5JPBrOgeXszJlQSS2mNKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoT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jJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA0MTIyMjIzMDMwMVowIwYJKoZIhvcNAQkEMRYEFGScUcbHBR1nHK9zyWTmUbQdwwg7MA0GCSqGSIb3DQEBAQUABIGAMaQVLxySyNz8jWlvJC5CL2THVG1OazH5+DfvReOHI9irO8CuwCOsTFuGtb7pi4qFFQFAMWDeIO5t1g2j6YPNVZadS9jk99mL5KZG5ugWu2yyb8Mr/wd1mvqjd3GN1HRSnED0ZSrZF4ZtQ97iEOrrbVDKfVKb+wyNEc/tvV5UflA=-----END PKCS7-----
    ">
    </form>
    </li>
    <li><a href="http://www.spreadfirefox.com/?q=affiliates&id=27585&t=78"><img border="0" alt="Get Firefox!" title="Get Firefox!" src="http://sfx-images.mozilla.org/affiliates/Buttons/120x60/get.gif"/></a></li>
    <?php } ?>

    </ul>
    </div>

  5. DianeV
    Member
    Posted 8 years ago #

    phonakins, in the future, no need to post your entire menu code -- just include the pertinent parts so that people can spot what they need. As well, it looks like you've posted your Adsense affiliate code there; you might want to edit it out.

  6. biznet
    Member
    Posted 8 years ago #

    Thanks, that was exactly what I needed. Appreciate it.
    -Ken

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags