Ads Not Showing on Non-Supporter Blog (Pro Site)

We wrap Google ads with the following code to show or hide the banners in the header of all sites on our network, depending upon whether or not it is a Supporter Blog (Pro Site).

<?php
if (supporter_hide_ads()) {
	//do not show ads
} else {
	//show ads
	?>
<p style=&quot;text-align:center;&quot;>OUR AD CODE IS HERE</p>
<?php
}
?>

Yes, this is the legacy code provided with the Supporter plugin, but it has been working fine ever since the Pro Sites upgrade. I recently noticed, however, that one site in particular is not showing the ads. Upon further investigation, I discovered that the site has never been a Supporter.

I confirmed that another Non-Supporter site using the same theme, is showing the ads. So it's not specific to the theme.

I checked the wp_pro_sites table, and the Site ID in question is not listed.

The attached screenshot shows the _psts and _supporter rows that I found in the _options table for the site in question, yet even after deleting those entries, the ads still do not show. (NOTE: The _withdrawn and _action_log entries were likely only there because I manually extended and withdrew Pro Site status while troubleshooting the ad issue.)

Any idea why the ads would be showing on most non-supporter sites, as they should, but do not show on one specific site? Is there somewhere else in the db I should be looking for the cause?

For example...

Non-Supporter Site with Ads (as should be expected):
http://testify.tripawds.com/

Non-Supporter Site without Ads:
http://chocolatekisses.tripawds.com/

Any feedback is greatly appreciated. Thanks!

  • Michelle Shull

    Heya, jcnjr! Happy Friday!

    We're not actively supporting this legacy bit, we're focusing on a big Pro Sites update at the moment, but let's do a quick test and see if we can make this work.

    What happens if you give and revoke prosite status to that site? Do the ads show up? I know that's a bit clunky, but it may be the quickest way to get things going until I can get some feedback from the dev here.

    Let me know! If that doesn't give you a quick fix, we can dig in a bit deeper.

    Thanks for your question, hope you and all your tripawds friends are doing well!

  • jcnjr

    What happens if you give and revoke prosite status to that site?

    Tried that, for each level, with no change in ads not displaying...

    I sincerely hope the update will include new php code for wrapping ads in the header/footer on all sites, instead of just the option to show/hide ads within pages and posts. It just doesn't make sense that this is working on all our sites except one. :-\

    Thanks for any help you can provide!

  • Timothy Bowers

    Hey @jcnjr,

    It's been a while since we chatted, hope things are good :slight_smile:

    Any objections to changing the function there to see how a newer one goes?

    <?php
    if (is_pro_site()) {
    	//do not show ads
    } else {
    	//show ads
    	?>
    <p style=&quot;text-align:center;&quot;>OUR AD CODE IS HERE</p>
    <?php
    }
    ?>

    It's the same code, but this time it checks if the site is a Pro Site, if not show the ad.

    This function also takes two arguments if you wished to use it elsewhere:

    is_pro_site( $blog_id = false, $level = false )

    By default the current blog ID is used. The $level by checks to see if the site has any level at all, if you stick a specific level in there it will check against that level and below. So if you wanted you could display ads to specific levels or less.

    As it seems like you're using your own ad code I think this should work fine. Let me know.

    Take care.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.