WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Default AdSense Deluxe Code in Template (5 posts)

  1. eastbayinsomniac
    Member
    Posted 6 years ago #

    I am confused about how to implement the default
    AdSense-Deluxe code into my template. The plugin instructions state this:

    <<If you want to use the ads defined in Adsense-Deluxe within your WordPress templates, place the following code where you want the ads to appear:
    <?php adsense_deluxe_ads('Ad_Name'); ?>.
    Calling that PHP function without a parameter will return the default ad unit.>>

    I have 2 questions:

    1. Do I put the code in the index, the archive and/or
    the single post template? I want the ads to appear at the bottom of every blog post.

    2. What EXACTLY do I put in the template(s)?

    My block is this:

    Default Name <!--adsense-->
    Description: Blog post 2 ads, horizontal, 468x60
    banner, EBI v2.0 color palette

    Do I put this in the template?
    <?php adsense_deluxe_ads(); ?>

    (I tried this and the ads aren't showing up. I know I must have something wrong.)

    Thank you!
    Jeremy

  2. JeremyVisser
    Member
    Posted 6 years ago #

    You'll need to add the code in all of the pages you want the ads to show up. So, if you want the ads to show up under the blog posts on the index page, you'll want to add the code to index.php.

    Just after this:

    <?php the_content() ?>

    ...add your code:

    <?php the_content() ?>
    <?php adsense_deluxe_ads(); ?>

    Do the same for single.php. If you only put it in index.php, the ads will only show on the front page.

    If I remember correctly, Google restricts you to three ad blocks per page, so if you add the AdSense code to your index.php, only the top three blog posts will have ads.

    I hope this has cleared things up for you.

  3. saphruser
    Member
    Posted 6 years ago #

    the adsese deluxe plugin v.0.8 is not working for me i am on 2.2.2 version. but adsense works fine when i add code in text widgets..so i am looking to ad text widegets within the post.is it possible? has anyone tried inserting text widgets within a page/posts?

  4. eastbayinsomniac
    Member
    Posted 6 years ago #

    Hi Jeremy-

    I tried adding that to all of these:

    I added (to single):
    <div class="entry">
    <?php the_content('<p class="serif">'. __('Read the rest of this entry','mandigo') .' »</p>'); ?>

    <?php adsense_deluxe_ads(); ?>

    I added (to archives):
    <div class="entry">
    <?php the_content() ?>
    <?php adsense_deluxe_ads(); ?></div>

    I added (to index):
    <div class="entry">
    <?php the_content(__('Read the rest of this entry','mandigo') .' »'); ?> <?php adsense_deluxe_ads(); ?></div>

    I cleared the cache and everything, but I don't see any ads on either single, archives or index. (The ad block in the footer is not part of this widget.)

    Is there a problem with my actual code for the Ad Name? The instructions show:
    <?php adsense_deluxe_ads('Ad_Name'); ?>
    But it says "Calling that PHP function without a parameter will return the default ad unit."

    Here's a link to a post where ads SHOULD be showing:
    http://www.eastbayinsomniac.com/hungry/albany-bowl-thai-cafe

    Here's a link to a category where ads SHOULD be showing:
    http://www.eastbayinsomniac.com/category/bored/billiards-cards

    (On that note--is there a way to suppress "category" from the permalink to a category archive? In this instance, "bored" is the category.)

    Thanks-
    EBI

  5. eastbayinsomniac
    Member
    Posted 6 years ago #

    I got some private help on this, but I'm posting the solution in case anybody else runs into it.

    In the AdSense Deluxe control panel, I had disabled the display of the default AdSense block <!--adsense--> which needs to be enabled even to use the <?php adsense_deluxe_ads() ?> template tag.

    Ads are working. Case closed. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic