WordPress is more than a blog engine. It’s an easy-to-use CMS (Content Management System) perfect for running a “webzine.” I’m not a big fan of most CMS systems, though I’m a huge fan of WordPress. Joomla is too convoluted and Drupal isn’t that great either. I’m not going to go around the web bashing other CMSes right and left, but I do like to point out WordPress as a viable option for “non-blog” sites.
The Main Page
The main difference between a blog an a webzine is the index page. While the typical blog just shows the most recent posts, a webzine goes beyond that. There are a lot of ways to display content on the main page. Here are some examples of webzines:
- ProBlogger
- Revolution WordPress Theme
- The Leaky Cauldron
- The Morning After WordPress Theme
- CNet
- CNN
- Yahoo
Look around the internet. You’ll find no shortage of different “non-blog” index styles. Do you see how they are all similar? They highlight different types of content. “Featured” posts, “normal” posts, “news,” etc. Before you get into developing your webzine too much, map out the main page on paper. Decide what types of content you will have, and how you will display them on the main page.
How do you put more than one block of posts on a page? It’s not that hard…if you’re used to editing templates (which I assume you are, if you’re making your own theme). When you create the index.php template, you put in more than one Loop.
Suppose you wanted to put a box on the index with a list of links to featured posts. I do this on the Webmaster-Source homepage (in the middle column) if you want to take a look. You would create a category called “Featured Posts” (noting the category’s id) and use this code somewhere on the homepage:
<ul>
<?php
$postslist = get_posts('category=2&order=DESC&numberposts=5');
foreach ($postslist as $post) :
setup_postdata($post);
?><li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li><?php
endforeach;
?>
</ul>
For this to work, you need to replace 2 with the category id for your Featured Posts category.
By creating categories like “Features,” and “News,” and using multiple Loops to pull their most recent entries to the main page, you can divide-up your articles like a magazine. No matter how you want the index to look, you can do it with WordPress and some ingenuity.
Template Mania
Now that you have all these different types of content, you’ll need more ways to display them. What if you don’t want the category archives for the “News” category to look the same as the normal archives? What if you want it to look more customized…sort of like the index page? Here’s a little secret: You can have more than one category.php template. That’s right. If you copy the category.php template and rename it category-3.php WordPress will use category-3.php instead of category.php when the category archive for the category with the id of 3 is being displayed. That leaves you with plenty of room for customization.
Want to take that even further? How about having different single.php templates for posts in different categories? Just rename your normal single.php template to normal-single.php and create as many alternate single templates as you need. Next, create a new single.php and do something like this:
<?php
$post = $wp_query->post;
if (in_category('3')) {
include(TEMPLATEPATH . '/featuredpost-single.php');
} else {
include(TEMPLATEPATH . '/normal-single.php');
?>
Using if statements, you can tell WordPress to use different templates depending on the category. If you only need to make a minor tweak for a certain category, you don’t need to go so far as to have a separate template. You can just put
<?php if (!in_category('3')) { ?>
Whatever you want to appear on permalink pages that are not in category 3.
<?php } ?>
I use in_category() on my single post template. That way I can cut-out some of the extras if a post is in my Sideblog category.
Custom Fields
Custom Fields are an interesting, and underused, part of WordPress. They’re a way to add metadata to your posts. There are scores of things you can use them for in a webzine environment. Take a peak at NorthXEast.com. See the images next to the posts? They’re not exactly in the actual posts. They’re (I assume) done using Custom Fields.
To match an image up with a post, you use a “key” of “postimage” (or something like that) and for the value you put the URL of the image. Then you can put the image near the post like this:
<img src="<?php get_post_meta($post->ID, 'postimage', true); ?>" />
Simple.
You can do much more with Custom Fields than display images, but this is a common use.