This is a follow on tutorial from the previous one: Menu only logged in users or certain users can see

In this one Ive added a few extra features. I suddenly thought about the previous tutorial example and saw that any logged in user can see the control panel menu in the sidebar and all the options within it. What if you only want users of a certain level to see the ‘Write New Post’ and ‘Write New Page’ options.

OK Im just gonna list the whole block of code for the sidebar login that I have implemented on this site then talk a bit about the new bits:

  • Login

    Control Panel

    Control Panel

  • OK so if you have read my earlier tutorials on this topic you will recognise a lot of this code and Im not going over it here. So lets take a look at the new bits so we know what changes have been made.

    First new line is after the else statement. This basically sets the user level that can access the following menu code. I have set this to level 2, as users granted level 2 status on effutio can write posts etc, but you can set this to whatever level you like (see my previous login tutorial for WordPress pre set levels).

    Then you will notice I have added a second else statement which allows any other users which are lower than level 2 to see a different menu again. Because any user lower than a level 2 cant write posts etc they can only see the ‘Dashboard’ and ‘Logout’ links.

    Well I really love this login/menu code for the sidebar, I hope you do too.

    0

    One Response to “More Advanced Menu only logged in users or certain users can see”

    1. Neil July 29, 2009 at 9:32 pm

      If you are also running Simple Press forum on your WP site then listen up!

      I came up with a quirky issue that took me a bit to figure out but is very simple.

      The issue is with the control panel menu that appears upon login. If the user is not an admin and they try and click on the New Post or Page link it takes them to the forum home page?

      The fix is in the Forum admin. Click on ‘Manage Options’ scroll down a bit and uncheck the option ‘Block User Access to WP Admin Pages’ headed by ‘WP Admin Pages Acces’.

      I should have known the problem fix was there as the forum links in with the wordpress user database.

    Leave a Reply

    Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Switch to our mobile site

    © 2012 Effutio - All Rights Reserved

    Perth Web Design - Free Web Host