WordPress.org

Ready to get started?Download WordPress

Forums

Paid Memberships Pro
Disabling Ads for members (5 posts)

  1. secretagentducks
    Member
    Posted 1 year ago #

    Hello
    I am having trouble with my wordpress site http://sophisticatedstories.com
    I want to have it set up so that ads show up in the text of the stories (in text ads) and on the sidebar widget area. But I only would like ads to show to people who are not members and not logged in. I have installed a plugin called Paid Membership Pro which has been awesome in restricting content, buy not so awesome at restricting ads. When my test user who is a member logs in all the content is unrestricted, but ads are still present. In the advanced settings of Paid membership Pro I have set the settings to "Hide ads from all members" Underneath the settings it also says
    "Ads from the following plugins will be automatically turned off: Easy Adsense, ...

    To hide ads in your template code, use code like the following:

    if(pmpro_displayAds())
    {
    //insert ad code here
    }"

    I have installed Easy Adsense pasted my Adsense code into the "Widgets for sidebar section" The ads still show regardless of whether or not a member is logged in. So I tried the template code with the adsense code pasted in their. No luck.

    When I tried pasting the template code into a text box for the widget bar, The ads still show up, but "if(pmpro_displayAds())
    {" is displayed as a "class" = text if you look at the page source.

    Also in the Easy Adsense settings there is this:
    "If you want to suppress AdSense in a particular post or page, give the comment "<!--noadsense-->" somewhere in its text.

    Or, insert a Custom Field with a key "adsense" and give it a value "no".

    Other Custom Fields you can use to fine-tune how a post or page displays AdSense blocks:
    Keys:
    adsense-top, adsense-middle, adsense-bottom, adsense-widget, adsense-search
    Values:
    left, right, center, no"

    I will leave both the Easy Adsense and the text ads up on the sidebar where the widgets are so you guys can view for troubleshooting.

    As far as making this work I have no clue, I have tried so hard to make this work the past two days, and I need the communities help now. Please save me!

    Thanks for any help.

    http://wordpress.org/extend/plugins/paid-memberships-pro/

  2. strangerstudios
    Member
    Plugin Author

    Posted 1 year ago #

    Ducks,

    I'm not sure when, but at some point Easy AdSense updated their plugin and the way we were integrating with them failed. I've updated the DEV version of PMPro to include a fix for newer versions of Easy AdSense.

    The next PMPro update (sometime this week) will include the fix. If you want to patch your version PMPro now, you just need to add this code section to paid-memberships-pro.com in place:
    https://github.com/strangerstudios/paid-memberships-pro/blob/dev/paid-memberships-pro.php#L173-L179

    Thanks for the heads up RE this. Hope this helps.

  3. secretagentducks
    Member
    Posted 1 year ago #

    Hi!
    Thanks for the quick reply. I just got done testing the site with the new code and I had no luck. The ads still appear when logged in as a member. Now it could be that your code is fine, and maybe it's just my site, but it doesn't work for me.

    Maybe I am doing something wrong, not sure.

  4. secretagentducks
    Member
    Posted 1 year ago #

    OK here's what I did. Because you said that it worked with previous versions of Easy Adsense I downloaded Easy adsense 5.0. I found it under the developer tab for the easy adsense plugin here:
    http://wordpress.org/extend/plugins/easy-adsense-lite/developers/

    I downloaded it and then uploaded it to my site under the public html wp content plugins.

    I activated the plugin and did not update it.
    After that I started setting up the advanced settings for Paid membership Pro advertisements to be disabled for all members.

    After all that the ads did not show up. So 5.0 Easy Adsense and Paid membership Pro work*

    *they only work if the sidebar does not have priority. Under the Easy Adsense options there is an option for "Prioritize sidebar widget. (Always shows the widget, if enabled.)"

    Do not click it if you want it to be suppressed by Paid membership Pro. If you want more ads on the sidebar then click:
    "Any number of ad blocks (At your own risk!)"

    This will make more show up then just 1.

    Thanks for the help StrangerStudios.

    I hope this helps anyone else who is stuck :)

  5. strangerstudios
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for coming back and posting what worked for you. When I get a chance, I might process some of this more and try to make the integration with Easy AdSense (newer versions) more seamless.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic