Support » Themes and Templates » Trying to add Adsense code in posts after first paragraph

  • I’d like to insert Adsense code after the first paragraph in individual posts but before the rest of the story. I saw this topic which describes adding it after the excerpt:

    http://wordpress.org/support/topic/how-to-add-textad-after-moreexcerpt-in-posts?replies=20

    However, I’m encountering two problems with that solution:

    1. I’m using Magazine-Basic for my theme and the theme’s single.php file contains only the following:

    <?php get_header(); ?>
    	<?php get_template_part( 'loop', 'single' ); ?>
    <?php get_footer(); ?>

    I therefore can’t use the code from the topic referenced above.

    2. The excerpt cuts off arbitrarily after a certain number of characters, not at the end of the introductory paragraph so I’m not imagining that placing the ad after an excerpt, mid-sentence, would look terribly attractive.

    As a solution to the paragraphing issue I found this:
    http://www.wpbeginner.com/wp-tutorials/how-to-insert-ads-within-your-post-content-in-wordpress/

    However, that requires the same code in the single.php referenced in problem #1, above, that Magazine-Basic’s single.php file doesn’t have.

    Can someone who knows better than me (and that’s just about anyone!) point me in the right direction? Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trying to add Adsense code in posts after first paragraph’ is closed to new replies.