• I took over as Webmaster for my school’s website. In our old site we had a “secured” staff page that only staff could access. I need to recreate that within WordPress. My plan is to use the Simple LDAP plugin and then restrict the page to logged in users.

    However, I want a unique sidebar to post links for staff only (i.e. support ticket, request a sub, etc.). Also, we want to post announcements for staff only.

    I have a custom page template setup, but not sure how to have it’s widgetized sidebar. For example, instead of just primary sidebar and secondary sidebar, I’d like an option for staff sidebar (that, obviously, only shows up on the Staff page.)

    Also, if I create a category for staff only, can I keep that category private (even through RSS feeds and the like?)

Viewing 2 replies - 1 through 2 (of 2 total)
  • George

    (@georgegecewicz)

    You could make an action hook in your functions.php file like this (this is an example!):

    function admin_only_sidebar() {
      do_action('admin_only_sidebar')
    }
    function admin_only_sidebar_display() {
      if( is_admin() ) {
       // code here to register a sidebar or widgetized area, etc.
      }
      // then have an else statement to fall back on, like an
      // empty div or something
    }
    add_action('admin_only_sidebar','admin_only_sidebar_display');

    And then in the sidebar of your site drop in that action hook like this:
    <?php admin_only_sidebar(); ?>

    That might work, but check out proper code because I’m just making an example.

    I would recommend, personally, making a subdomain of your site for teachers and using something like the free P2 Theme, then just restricting access to admins and creating all the user logins for teachers…or using a membership plugin, etc.

    Thread Starter chargertech

    (@chargertech)

    Thanks George. I am thinking the same thing. With the sub-domain we could use a plugin to sync with our active directory server easy enough. I think it is a much better solution.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Page Template – Own Sidebar’ is closed to new replies.