[closed] Trying to add Adsense code in posts after first paragraph (3 posts)

  1. FirstTracks
    Posted 4 years ago #

    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:


    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:

    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!

  2. Samuel B

    Posted 4 years ago #

  3. FirstTracks
    Posted 4 years ago #

    Thanks, Samuel. Found this one too that will let me use any ad code, not just AdSense:


    Hadn't thought of a plugin, actually...thanks for pointing me in that direction.

Topic Closed

This topic has been closed to new replies.

About this Topic