-
Author
-
February 17, 2017 at 18:37 #153317
hejms
ParticipantHi Sweetdate Support.
I just got accepted by Google to use ads on my site.
Paid Membership Pro says that you should use a plugin called “Easy Adsense” if you want to hide the ads for some memberships, but I can’t seem to find any plugin that are called that?
It also suggest you can write ”
COPY CODEif(pmpro_displayAds()) { //insert ad code here }”
around the script, but if I do that it doesn’t work at all.Or maybe I’m just doing it wrong?
I put a widget with text/html and write the code, but it doesn’t do anything.If I write it without “if (pmpro displayAds())” and so on, it works, but then all my members can see the ads, and isn’t hidden for VIP-members.
Kind regards
HenrikFebruary 19, 2017 at 20:16 #153441Laura
ModeratorHello, this one? https://es.wordpress.org/plugins/easy-adsense-lite/
You could use this insteadCOPY CODE<?php if ( pmpro_hasMembershipLevel(array(3))) { ?> AD SCRIPT HERE <?php } ?>Basically, the membership level 3, can see ads, the others wont
Just change the numberHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 19, 2017 at 22:01 #153454hejms
ParticipantYeah that was the plugin I found, but that doesn’t hide the ads automatically like the plugin Paid Memberships Pro were talking about 🙂
But I tried to use your code inside the plugin, but it doesn’t work. It shows the ads for all membership users (all ID’s).
I then tried to write it into the Text/HTML widget, but it just says “Error occurred. Please reload the page and try again” and it doesn’t save the code inside it.
February 21, 2017 at 01:51 #153633Laura
ModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 21, 2017 at 18:13 #153715Radu
ModeratorHi,
This conditional tag it works make sure to not making something wrong
COPY CODE//1,2 represents id's of packages that you want to see your message if(pmpro_hasMembershipLevel(array(1,2), get_current_user_id())){ echo 'banner code' ;} }Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 21, 2017 at 23:37 #153775hejms
ParticipantHmm I’m not exactly sure where you want me to write this code? :/
February 22, 2017 at 13:34 #153869Radu
ModeratorIf you use those in widget area the php codes sure will not work and you will have to use shortcodes
All pmpro conditional shortcodes are here :

So you will have to place your banner code inside the shortcodes
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 22, 2017 at 15:06 #153883hejms
ParticipantOkay but where exactly should I write these?
If I write them inside the plugin, the ad shows, but there’s also the text “[membership level=”0,2″]” before the ad, and “[/membership]” after the ad.And if I write anything in the text-widget it just says error, and nothing works.
February 22, 2017 at 19:07 #153914Radu
ModeratorFrom example in the widget area as you had said in the initial post
[membership level=”1″]
banner code for level 1
[/membership]the shortcodes works in text area from widgets

And so on..
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 22, 2017 at 23:19 #153931hejms
ParticipantThank you, that works!
The problem was that I went into “Appearance – Customize” and then put the text into widgets in there.
And that didn’t work.But this method works, thank you 🙂
February 23, 2017 at 15:33 #153992Radu
ModeratorGreat
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.