Title: Limiting access from theme
Last modified: August 31, 2016

---

# Limiting access from theme

 *  Resolved [PS85](https://wordpress.org/support/users/tmgmw/)
 * (@tmgmw)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/limiting-access-from-theme/)
 * Hi,
 * Plugin works perfect, thank you,
 * But i would like to know if i can restrict things from the front end by checking
   if the user currently logged in belongs to a membership level that has access.
 * Like an if statement by user level specied
 * [https://wordpress.org/plugins/restrict-user-access/](https://wordpress.org/plugins/restrict-user-access/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/limiting-access-from-theme/#post-7097276)
 * If you want to edit your theme templates, you can use this code:
 *     ```
       if(is_user_logged_in() && rua_has_user_level(get_current_user_id(),$level_id)) {
           ...
       }
       ```
   
 * If you do not know the ID of the level, you can use this code to get it:
    `$level_id
   = rua_get_level_by_name($name);`
 * If you instead want to restrict some content in your pages or posts based on 
   level, look at my answers in this thread:
    [https://wordpress.org/support/topic/is-it-possible-to-just-restrict-the-button-and-not-entirely-the-page-or-a-post?replies=6](https://wordpress.org/support/topic/is-it-possible-to-just-restrict-the-button-and-not-entirely-the-page-or-a-post?replies=6)
 * Let me know if this works for you.
 *  Thread Starter [PS85](https://wordpress.org/support/users/tmgmw/)
 * (@tmgmw)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/limiting-access-from-theme/#post-7097304)
 * Thanks Joachim, it worked
 *  Plugin Author [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/limiting-access-from-theme/#post-7097313)
 * That is great!
 * If you run into more problems, do not hesitate to open a new support thread here.
   And if you like Restrict User Access, please leave a review here: [https://wordpress.org/support/view/plugin-reviews/restrict-user-access](https://wordpress.org/support/view/plugin-reviews/restrict-user-access)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Limiting access from theme’ is closed to new replies.

 * ![](https://ps.w.org/restrict-user-access/assets/icon-256x256.png?rev=1815922)
 * [Restrict User Access - Ultimate Membership & Content Protection](https://wordpress.org/plugins/restrict-user-access/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-user-access/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-user-access/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-user-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-user-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-user-access/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/limiting-access-from-theme/#post-7097313)
 * Status: resolved