Title: Problem adding Adsense ads.
Last modified: August 20, 2016

---

# Problem adding Adsense ads.

 *  Resolved [satpan](https://wordpress.org/support/users/satpan/)
 * (@satpan)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/)
 * Hello freinds,
    I’m using WP 3.5 and Twenty-Twelve theme. I want to add adsense
   ads in **all posts below post title** but **don’t want these ads to show on Home**,
   any help?????

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [Riversatile](https://wordpress.org/support/users/riversatile/)
 * (@riversatile)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349423)
 * Simple !
    Place the Google Adsense code into the **single.php** file (all post
   pages). But not on **index.php** file which is home page.
 *  Thread Starter [satpan](https://wordpress.org/support/users/satpan/)
 * (@satpan)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349432)
 * Thanks riversatile,
    I tried it, but ad is showing **above post title**, what
   if i want to show it **below post title**
 * sinlge.php code is this:
 *     ```
       <?php
       /**
        * The Template for displaying all single posts.
        *
        * @package WordPress
        * @subpackage Twenty_Twelve
        * @since Twenty Twelve 1.0
        */
   
       get_header(); ?>
   
       	<div id="primary" class="site-content">
   
       		<div id="content" role="main">
   
       			<?php while ( have_posts() ) : the_post(); ?>
       <?php get_template_part( 'content', get_post_format() ); ?>
   
       				<nav class="nav-single">
       					<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
       					<span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentytwelve' ) . '</span> %title' ); ?></span>
       					<span class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentytwelve' ) . '</span>' ); ?></span>
       				</nav><!-- .nav-single -->
   
       				<?php comments_template( '', true ); ?>
   
       			<?php endwhile; // end of the loop. ?>
   
       		</div><!-- #content -->
       	</div><!-- #primary -->
   
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>
       ```
   
 * _[In future, wrap code using backticks please_]
 *  [Riversatile](https://wordpress.org/support/users/riversatile/)
 * (@riversatile)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349441)
 * OK… I can see this template is calling another template :
 *     ```
       ...
       <?php get_template_part( 'content', get_post_format() ); ?>
       ...
       ```
   
 * So you can’t place the Google Adsense code here if you want to place it below
   the post title, because the post title PHP function is in the secondary template.
 *  Thread Starter [satpan](https://wordpress.org/support/users/satpan/)
 * (@satpan)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349445)
 * Thanks again,
 * I have also tried it in **content.php**.
    Ad is showing below title but also 
   showing in home, is there any way??? I don’t have much knowledge of php.
 *  [Riversatile](https://wordpress.org/support/users/riversatile/)
 * (@riversatile)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349448)
 * Certainly because **content.php** is also called in **index.php** (home)
 * You can perhaps made a copy of **content.php**, call the file **post-content.
   php**, put the Google ad code in it and call the file **post-content.php** in
   your **single.php** file by doing this :
    replace this code `<?php get_template_part('
   content', get_post_format() ); ?>` by this code `<?php get_template_part( 'post-
   content', get_post_format() ); ?>`
 * Like that, the Google ad should not appears in home.
 * [For more information about get_template_part](http://codex.wordpress.org/Function_Reference/get_template_part)
 *  Thread Starter [satpan](https://wordpress.org/support/users/satpan/)
 * (@satpan)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349453)
 * Thank You very-very much…
    It works great!!!! **[http://www.satpan.org](http://www.satpan.org)**
 *  [Riversatile](https://wordpress.org/support/users/riversatile/)
 * (@riversatile)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349471)
 * You’re welcome
 *  Thread Starter [satpan](https://wordpress.org/support/users/satpan/)
 * (@satpan)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349473)
 * I have one more question if you don’t mind.
    when i click on your username “riversatile”
   it redirect to your website. How can i link my website to my username???
 *  [ejortol](https://wordpress.org/support/users/ejortol/)
 * (@ejortol)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349630)
 * Hello. In which part of post-content.php place the adsense code?
    Thank you.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 3 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349631)
 * [@ejortol](https://wordpress.org/support/users/ejortol/),
    You can discuss that
   [on your own thread](http://wordpress.org/support/forum/how-to-and-troubleshooting#postform).

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Problem adding Adsense ads.’ is closed to new replies.

## Tags

 * [WP3.5](https://wordpress.org/support/topic-tag/wp3-5/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 4 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/problem-adding-adsense-ads/#post-3349631)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
