WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding Adsense-deluxe to single.php (5 posts)

  1. GadeTerbob
    Member
    Posted 8 years ago #

    This code works when added to single.php:
    <?php adsense_deluxe_ads('leaderboard'); ?>

    While this doesn't:
    <?php if(function_exists('leaderboard')): adsense_deluxe_ads('leaderboard'); endif; ?>

    No error, just doesn't work. What am I missing?

  2. jaredquinn
    Member
    Posted 8 years ago #

    I don't think 'leaderboard' is actually a valid PHP function, perhaps you would be better off with:


    if(function_exists('adsense_deluxe_ads')) {
    adsense_deluxe_ads('leaderboard');
    }

    To check that adsense is installed before calling your ads, if you want to check that the actual ads exist, you could try something like (note: untested):


    if(function_exists('adsense_deluxe_ads')) {
      $options = get_option('acmetech_adsensedeluxe');
      if(isset($options['ads']['leaderboard']))     adsense_deluxe_ads('leaderboard');
    }

  3. GadeTerbob
    Member
    Posted 8 years ago #

    Thanks! To check if the ad option exits is my goal. I'll test the code.

  4. jaredquinn
    Member
    Posted 8 years ago #

    Let me know if you have any issues with it at all.

  5. GadeTerbob
    Member
    Posted 8 years ago #

    Yup! Works good and lasts a long time!! Thanks!!

Topic Closed

This topic has been closed to new replies.

About this Topic