Support » Fixing WordPress » How to prevent Push Ads on specific roles

  • Hello

    I’m adding some ads on my blog and I want the donors not to see those ads (Browse the site ad freely) for specific periods depending on their donations

    What Should I do to accomplish this?

    • This topic was modified 5 months, 2 weeks ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • It depends on how you are adding the ads? Via a plugin or hard coded in?

    if you’re hard coding them you can use the following to display something to everyone who isn’t an author.

    
    <?php
    $user = wp_get_current_user();
    if ( !in_array( 'author', (array) $user->roles ) ) {
      // do your ads
    }

    isn’t there a plugin that can do the whole process for me?

    This plugin does role based ad management, you will need to check other plugins for other features you want.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.