WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to put ads with posts (9 posts)

  1. dinzan
    Member
    Posted 6 years ago #

    How to put ads along with posts ? I tried the adsense manager plugin and I didn't like it..

    So far, I tried editing the single post.php file and ads come, but I want to blend them with the post, that is show like when we put an image.. text moves to the right side or left side of the ads...if u understand what I mean

  2. dinzan
    Member
    Posted 6 years ago #

    Example page ... I have a small box of ad here.. but the ad comes first, then the content.. I want to show the ads on the right side of the content.. like we align an image..

    http://dinsan.info/2008/01/15/do-you-use-yahoo-mail/

  3. Sridhar Katakam
    Member
    Posted 6 years ago #

    That should be simple to do.

    Put the ad code in a div and give this div a class, let's say "adsense_singleview_right"

    Then in your style.css,

    .adsense_singleview_right {
    float: right;
    display: block;
    margin-left: 10px;
    margin-bottom: 5px;
    }

  4. dinzan
    Member
    Posted 6 years ago #

    Hi,

    thanks for the reply..

    I added following to style.css

    adsense_singleview_right {
    float: right;
    display: block;
    margin-left: 10px;
    margin-bottom: 5px;

    and following to the single.php

    div id="adsense_singleview_right">
    <script type="text/javascript"><!-- ... ( adsense code continues )

    and no luck :(

  5. Sridhar Katakam
    Member
    Posted 6 years ago #

    I tried this on my localhost and it worked just fine.

    Make sure you paste the adsense div immediately below:

    <p class="post_author">by <?php the_author(); ?></p>

    in single.php

  6. dinzan
    Member
    Posted 6 years ago #

    can you show me the entire code.. so that I can try copy pasting ?

  7. dinzan
    Member
    Posted 6 years ago #

    Anyone ? :(

  8. Sridhar Katakam
    Member
    Posted 6 years ago #

  9. dinzan
    Member
    Posted 6 years ago #

    thank you....... that worked :)

Topic Closed

This topic has been closed to new replies.

About this Topic