• I am a beginner at all of this an amateur at CSS and HTML. I want to add my adsense into my side bar. The adsense code is:

    [please read the forum guidelines for posting code about marking any code in your topic]

    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-1300426252265454";
    /* MotivationStart */
    google_ad_slot = "3746833696";
    google_ad_width = 160;
    google_ad_height = 600;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    My sidebar code is as follows (copied from wordpress dashboard):

    <?php
    /**
     * The Sidebar containing the main widget area.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    $options = twentyeleven_get_theme_options();
    $current_layout = $options['theme_layout'];
    
    if ( 'content' != $current_layout ) :
    ?>
    		<div id="secondary" class="widget-area" role="complementary">
    			<?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
    
    				<aside id="archives" class="widget">
    					<h3 class="widget-title"><?php _e( 'Archives', 'twentyeleven' ); ?></h3>
    
    <ul>
    						<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
    					</ul>
    				</aside>
    
    				<aside id="meta" class="widget">
    					<h3 class="widget-title"><?php _e( 'Meta', 'twentyeleven' ); ?></h3>
    
    <ul>
    						<?php wp_register(); ?>
    
    <li><?php wp_loginout(); ?></li>
    						<?php wp_meta(); ?>
    					</ul>
    				</aside>
    
    			<?php endif; // end sidebar widget area ?>
    		</div><!-- #secondary .widget-area -->
    <?php endif; ?>

    Can someone tell me where to insert the code or insert it for me so I can copy and paste? Once I see it done I’ll be able to research and learn it more for the future, I just have no idea where to start.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    After this
    /**
    * The Sidebar containing the main widget area.
    *
    * @package WordPress
    * @subpackage Twenty_Eleven
    * @since Twenty Eleven 1.0
    */

    the easiest would be to paste the adsense code into a textwidget.

    bt:
    do not edit the default theme Twenty Eleven directly, but create a child theme first, to work with; http://codex.wordpress.org/Child_Themes

    Thread Starter Jwang1228

    (@jwang1228)

    Thanks for the quick responses!

    Got it to work thanks

    Since this thread is still open…

    I want to use adsense so I enabled a right sidebar in my twentyeleven theme. What I would like to do is have that sidebar available on all the pages and my blog but NOT on the Home page. Is that an easy answer or should I start another thread? I’m working in a test environment right now so I haven’t implemented the sidebar on the production site yet.

    As per the Forum Welcome, please post your own topic. Your problem – despite any similarity in symptoms – is likely to be completely different.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Another Help Implementing Adsense’ is closed to new replies.