WordPress.org

Ready to get started?Download WordPress

Forums

Putting Adsense without Single.Php (3 posts)

  1. campea
    Member
    Posted 8 years ago #

    I'm new to WP, and I've run into a problem.

    I want to put adsense code in so that the ad appears inline with the post on it's individual page (ie. the comment page) not on the front page.

    I've read that I can put the code in the single.php file... except that the theme I'm using doesn't have a single.php file. it has:
    comments-popup.php
    comments.php
    footer.php
    header.php
    index.php
    sidebar.php
    style.css
    but no single.php

    So how do i go about inserting the adsense code into the individual page without a single.php file? Please help.

  2. tomhanna
    Member
    Posted 8 years ago #

    Could you use:

    <?php if (is_single()) { echo 'YOUR ADVERTISING CODE';} ?>

  3. Beel
    Member
    Posted 8 years ago #

    Or hit the codex for instructions and make your own single.php page.

Topic Closed

This topic has been closed to new replies.

About this Topic