Using WordPress as a Content Management System, Part 2
(Page 3 out of 3)The FAQ section
The FAQ section is also pretty simple, although we will need a custom 'Post' template, just like the article section. First of all, create a new category, this time called 'FAQ' to hold all our FAQ entries. Secondly, we have to create a custom template for FAQ's, but before we do that, let me explain how our FAQ entries will work.
A FAQ usually contains 2 or 3 things: a title, a question, and an answer. Sometimes they also have a description, but that's something we're going to skip. In our FAQ entry the excerpt will be the question, and the content will be the answer. The title will be the title, obviously.
All we need for the FAQ section is a custom entry page, and a custom category page. We've already done both things, so this should be a piece of cake for you. Simply copy the following file: faq.source.phps and save it as faq.php in your template directory. If you have a look at the source, you'll notice that we use the_excerpt() and the_content() template tags.
That's all for the FAQ section. Don't forget to create a custom category page, so the default archive template won't be used.
Conclusion
In this tutorial, I have shown you the steps necessary to convert WP into a content management system. Surprisingly, this is easier than it seems, and it doesn't require any code modifications at all. I hope you now have an idea of how WP works, and are able to use WP for your own website. If you need some extra functionality, or can't get something working, don't forget about plugins. They're extremely useful for solving problems, or adding new things to your WP install.
If you have trouble following this tutorial, or you need some help, hop over to the PHPit Forums and I'll try to assist you wherever I can. Any comments are also very welcome, and can be left below.
November 15th, 2005 at 6:09 pm
[…] PHPit - Totally PHP » Using WordPress as a Content Management System, Part 2 […]
January 26th, 2006 at 7:59 am
[…] part 1 | part 2 […]