This topic has 10 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #183200
     graphite
    Participant

    Hi,

    Can I prevent certain pmpro levels from creating a Buddypress group?

    The old code seems not working:

    header.php <?php if ( pmpro_hasMembershipLevel(array(2,3))) { ?> <style> form#groups-directory-form .button:nth-child(2n) { display: initial !important; } </style> <?php } ?>

    style.css form#groups-directory-form .button:nth-child(2n) { display: none !important; }

     

    Thank you 🙂

    #183251
     Kieran_SQ
    Moderator

    Hi,

    Thanks for reaching out, can you please update this ticket with some admin credentials so I can have a look at both the front and back end.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #183267
     graphite
    Participant
    This reply has been set as private.
    #183277
     Kieran_SQ
    Moderator

    Hi,

    Please can you test the change I just made with an admin account and a standard user with the membership level that should not see the create group button.

    I changed the PHP used in the header.php file to

    COPY CODE
    <?php if ( pmpro_hasMembershipLevel(array(2,3))) { ?>
    <style>
    li#group-create-nav {
        display: initial !important;
    }
    </style>
    <?php } ?>

    I also changed the CSS used in style.css to

    COPY CODE
    li#group-create-nav {
        display: none !important;
    }

    If you are caching for logged in users please make sure to clear your website cache and local cache (Ctrl+F5) when you log out of X account to switch to the other.

    Thanks,

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #183359
     graphite
    Participant
    This reply has been set as private.
    #183420
     Kieran_SQ
    Moderator

    Hi,

    I will refer this ticket to a developer for review as it doesn’t seem to working with a CSS rule for unset. They’ll be in touch with you as soon as they can, Monday to Friday, East Europe Time.

    Thank you for your patience,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #183563
     graphite
    Participant

    Thank you Kieran!

    Looking forward to receiving the reply 🙂

    #183614
     Radu
    Moderator

    Hi,

    The problem it’s because of this rule from the style.css

    COPY CODE
    
    
    li#group-create-nav {
        display: none !important;
    }
    
    

    You will have to remove the important, so the code will be

    COPY CODE
    
    
    li#group-create-nav {
        display: none;
    }
    
    

    Let me know

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #183658
     graphite
    Participant

    It works now, thank you Radu.
    Merry Christmas 🙂

    #183666
     graphite
    Participant

    For the record, it uses following on function.php:

    <?php if ( pmpro_hasMembershipLevel(array(2,3))) { ?>
    <style>
    li#group-create-nav {
    display: unset !important;
    }
    </style>
    <?php } ?>

    #183693
     Radu
    Moderator

    Hi,

    Merry Christmass!

    Great if it works

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?