Wordpress as CMS

After linked by Matt, I got some requests to share how I hacked up Wordpress for the Stanford Community Health Resource Center. So here we go. (Note: I'm sure there's cleaner ways to do a lot of this, and probably some of it WP can do intrinsically. I'd love feedback! And if you want any of the code, I'm happy to share.

A little background: I'm a medical student at Stanford, active in community health work, and the Community Health folks (who currently don't have a place for students to interact and share resources and information--boo, Stanford) got a mini-grant to get someone to develop an online community health center. Enter me, the general computer nerd of the class.

We wanted a place that could house a bunch of community-health related links, but primarily we wanted a site where students could post their community health projects, as well as their contact information and their community partner's information. The way it currently works, there's lots of students who have done community health work, but the incoming students have no idea who they are because the former are off doing rotations at the hospital, and don't really interact with the first and second year students. I had been reading a bit about Wordpress, and I've kinda taught myself basic (read: really crappy) PHP over the past couple years, so I figured I could probably figure out the code and bend it to my will make it work for the community health site. Also: we didn't want to have to create ANOTHER login for students, because we already have 50 different ones at Stanford, and we thought people wouldn't use the site if they had to register, login, etc.

I did all the coding using NoteTab Light, a little freeware Notepad replacement. (I wish it had color coding, but oh well.) I did all the testing on my WinXP laptop, and I MUST recommend EasyPHP. It installs Apache, PHP, MySQL, and PHPMyAdmin for you, it's free, and it just plain rocks. (Note: if you use the same DB from your local php install onto your server, you have to change the WP_OPTIONS TABLE SITEURL to the online URL, AND change the WP_OPTIONS TABLE'S HOME to the online URL. It took me forever to figure out why this wasn't working.) Also, thanks to Stanford IRT for hosting the site. Enough of that. Now on with the show.

I guess I'll just go page by page here and try to highlight the changes I made.

  1. index.php (template file)
  2. For the list of students page and the list of community partners pages, I used the get_custom plugin. (Much easier that way.) Thanks to Scott for helping me with it, I had a couple brain farts.
  3. The resources page is basically just pulling all the links from Wordpress's links manager, and organized by category. Used nicetitles for links.
  4. There are two users of the system, an administrator will full access, who can approve posts, and a basic user who can post new projects and edit old ones, but anytime they click "save" it turns the post into a draft. I'll show screenshots using the administrator and then just show relevant differences with the basic user login.

    add or edit a project page (there's no edit basic or edit advanced, because I always wanted control over publishing, and always wanted the meta-data input stuff to show up):
  5. the edit screen:
  6. Options: turned off most of the fancy-stuff as well as comments.
  7. basic user screens (note most options aren't available, instructions slightly different)

    and the edit screen: