WordPress.org

Forums

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

  1. FirstTracks
    Member
    Posted 3 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:

    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!

  2. Samuel B
    moderator
    Posted 3 years ago #

  3. FirstTracks
    Member
    Posted 3 years ago #

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

    http://wordpress.org/extend/plugins/quick-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