Plugin Author
ERA404
(@era404)
You can put this into a template using the above code, not into the wordpress backend, which will render all PHP code as html.
Open any template (example: front-page.php) in your favorite text editor, and insert the code (anywhere outside of the wordpress loop).
A little bit more involved, you could create a new template for your staff directory page.
a) Duplicate ‘page-templates/front-page.php’ and rename it ‘page-templates/directory.php’
b) Change the top line comment to read:
* Template Name: StaffList
c) Insert the stafflist code just below the content div and above the wordpress loop, like this:
<div id="primary" class="site-content">
<div id="content" role="main">
<?php new stafflist(); ?>
<?php while ( have_posts() ) : the_post(); ?>
d) Now, with the wordpress backend, make a new page and use the custom StaffList directory template instead of the default for each page you would like StaffList to appear.
Quick References
Editing Files « WordPress Codex