WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Adsense in single.php twenty twelve.

[Resolved] Adsense in single.php twenty twelve.

  • Hello. Turns Twenty Twelve theme has a single.php file something different from other subjects. From what I read in the forum this issue is resolved. They have done as follows: content.php file copied and have called post-content.php, File sigle.php changed
    <? Php get_template_part (‘content’, get_post_format ());?>
    By this other
    <? php get_template_part (‘post-content’, get_post_format ());?>
    and have placed the AdSense code in the post-content.php
    Anyway, I do not know where in the post-content.php file I have to put the adsense code to display below the post title. I hope I explained correctly.
    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • WPyogi
    Forum Moderator

    @wpyogi

    Are you using a child theme? You absolutely should not be modifying theme files, especially in a default theme.

    http://codex.wordpress.org/Child_Themes

    My knowledge is pretty basic. A little bit of everything. I do not intend to modify the default theme, but to create a new php file copying an existing one. The problem I have is that I do not know what part should I place the adsense code. All these I have found here:
    http://wordpress.org/support/topic/problem-adding-adsense-ads?replies=11
    I tried asking but a moderator told me to open a new discussion. Sorry for my English, I speak Spanish and use a translator.
    Thank you.

    WPyogi
    Forum Moderator

    @wpyogi

    You still need to use a child theme http://codex.wordpress.org/Child_Themes

    Have you looked at using a plugin for the Adsense?

    http://wordpress.org/extend/plugins/search.php?q=adsense

    (BTW, your English is fine 🙂 – or the translator does a good job!)

    Michael
    Moderator

    @alchymyth

    where in the post-content.php file I have to put the adsense code to display below the post title.

    possibly after this line (line 31):

    </header><!-- .entry-header -->

    Hello again. Alchymyth indications have worked perfectly. Is there, after line 31, where you have to place the adsense code to come out just below the post title. Thanks a million. I am happy to have received your support.
    Wpyogi On the other hand, I have enough on my wordpress plugin and I’ve read that overload the blog. So I try to use as little as possible. Moreover, so I’m learning more things.
    It was a pleasure to receive your help and I am very grateful.
    Sincerely,
    ejortol

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Adsense in single.php twenty twelve.’ is closed to new replies.