WordPress As A CMS: Getting Started

In This Post: The Dashboard De-mystified. Posts or Pages? Categories &Category Relationships. Changing the Look of the Default Sidebar. The Plugins I Like.

Maybe you’ve already chosen WordPress or are seriously considering it. Maybe you’ve even already done the famous 5 minute WordPress installation. Maybe you’ve already chosen one of the free themes or enlisted some paid help getting one made just for you? Whatever the case, you should be very pleased with yourself to have gotten this far and I’ll bet you’re super jazzed to have your own website that uses your own domain name.

Trouble is, now what? How to make sense of the Dashboard? What does what? What do all these crazy terms mean? You’re scared to touch anything! Some settings are self explanatory but the only way to get comfortable is to jump in and start looking and reading. It’s like a new house with lots of rooms and who can stand not knowing what all the rooms look like? If you don’t think its a good idea to change a setting, don’t. But don’t be afraid to at least log in and look at the pages – because just looking does no harm.

Dashboard Settings

General – where your site title and description goes.
Writing -where you pick the default post category.
Reading – controls what the first page of your site shows which, by default, are your posts. You can make a page called Home and pick that to be the first page. Go to Pages >> Add New and create it there. But then you should also choose another page to show the blog posts. So make another page and choose that to be your posts page. You can be very creative with the title: Jeffery Zeldman titles his “The Daily Report” and I think that is pretty cool.Because there is so much one can do with Templates this section really deserves a complete post. But to keep things going I’ve kept it short.
Discussion controls your comments.
Media – choose image sizes
Privacy – choose whether or not search engines can index your site.
Permalinks – choose the way your linkage is set up.
Miscellaneous – pick where your images get uploaded- default is uploads. Also by default they are separated into year and month folders.

And just because I care here are some screenshots to illustrate each page.

Default Blues
All first time WordPress installations have one category, one page, one post and one comment. I can’t tell you how many About Me pages I’ve seen explaining what a Page in WordPress is and how many posts I’ve seen in Uncategorized, too for that matter. You’re expected to rename, edit or delete that stuff. You can’t delete the Uncategorized category (because WordPress needs at least one category) but you can rename Uncategorized to something more personalized like Random or General…The main point is the more you change stuff the more you make it your own. Don’t leave something as is if it is going to be visible on your site. Tip: In your User Profile page, you can type in the name you want to appear in the greeting in the dashboard or next to your posts and then click save. Then you can choose this name from the drop down list box and this will be the author name (and might appear next to your posts if your template allows this). Isn’t Posted by (your name) better than “Posted by admin”?

Sidebars
Default sidebars tend to show everything from a pages menu to a calendar, this is because there aren’t any widgets being used yet. Once you add widgets – only the content displayed by those widgets will show in your sidebars.

The Empty Website Blues 🙁
At this stage you don’t need to worry too much about how your sidebar will look and which widgets to use. You have bigger fish to fry! The biggest problem for nascent websites is the lack of content. The most important thing to focus on right now at this stage of your site is adding some.

Should You Use Pages or Posts?
WordPress as a CMS is more powerful when it is used as it was meant to be used which is the displaying of posts assigned to categories. Pages should be used for About Me, Contact and Photo Galleries or whatever- as long as that content is going to remain the same for an extended amount of time. If you really really don’t need Posts and even though that will leave your site pretty limited go ahead and use only Pages. Its your website! WordPress can make a new Page as easily as it can add a new Post,that’s why it is such a great CMS.

What Do Categories Do?
Categories organize your posts. Categories make it possible to keep post content separate from other post content.
Example: If you write about Celebrities you could make a child category of Celebrities called Angelina Jolie. Whenever you add a new post about ms.thing you would choose the Angelina Jolie category. Then you could have a list in your sidebar of your posts about Celebrities with a nested list of posts about Angelina Jolie. You could make as many of these “Celebrities” child categories as there are celebrities!
If your posts will only pictures of Celebrities then make a child category of Celebrities called photos with a grandchild category called Angelina Jolie. In my mind that is a very practical use of the grandchild category. More about that later on in this post.

Categories Run Everything!
Many people misunderstand categories. They either don’t use them at all or they make up a new category each time they write a new post.

The folks that add a new category for each new post could eventually have a totally bloated amount of categories, each with just one post assigned to it. This defeats the purpose and makes it just as hard to find interesting content as if there were no categories at all. Try instead to use a few Parent categories and then use as many Tags as you want.

On the other end of the spectrum are the people who don’t use or create any new categories,ever so all their posts go into Uncategorized.

Before you get started think about whether the desire for a certain kind of category widget is behind your motivation for creating categories. Ideally, the organization of content should not be determined by a stylistic preference but rather because it is a vital step towards helping people find what they are looking for.

The Parent, Child and Grandchild Category Relationship
If you want to set up parent, child and grandchild relationships for your categories, first you need to know what the main focus of your site is going to be. If the focus is going to be on Kitchen Supplies, here is one way to begin cataloging that vast area. Although I do think this kind of micro managing of categories better suits product pages, not post pages.

Parent Category: Cutlery

Child : Fork
Grandchild : Salad Forks
Child : Seafood Forks
Grandchild : Shrimp Forks
Grandchild : Crab Forks

Child : Spoon
Grandchild: Dessert Spoons
Grandchild : Soup Spoons

Child : Knife
Grandchild : Steak Knives
Grandchild : Butter Knives

I could be wrong but I have managed quite a few WordPress as a CMS type websites for over 3 years and not one of my clients (so far) ever really needed a grandchild category relationship.

There are plugins for practically everything. When choosing plugins, keep in mind you are inviting code into your WordPress site that might conflict with other plugins, might not use code that produces 100% valid XHTML, might make you fall in love with it only to be dropped by the plugin creator next month. And might just not work! But here are some I swear by.
All In One SEO (by default WP is pretty SEO challenged)
XML-Sitemaps (then you can submit a sitemap to Google Webmaster Tools)
Flexi Pages (build your own sidebar page menu that shows only pages you want)
WP Database Backup (if disaster strikes- this is plugin is going to save your hide)
Tiny Contact Form (little contact form)
Cforms (build any kind of form you can think of)
WP-Ecommerce (online shop plugin, robust and highly supported with frequent upgrades and an active user forum, vital!)
NextGen (excellent photo gallery and album manager)

Nags:
If it is a business site keep the personal topic posts to a minimum, less than 5%. Set up a category called Personal so it will be obvious what that section is about.
Be careful with what you reveal, even sites meant to be 100% personal don’t need to get too personal.

RSS or Screen Scrape?

RssRascal!
Rss you rascal!
Why would you need to ever screen scrape content from your own website? Why not just use RSS feeds? If you want to use your own RSS feeds from your own content to display it somewhere else on your site you can do that! But what if there isn’t an RSS feed from the section in question ? What can you do?

I desperately needed to do just that and worked non stop until I got it hashed out. The blah blah below is what I did and why I had to do it.

Task: build a site using the expensive shopping cart that your client purchased. The client has big expectations and you are faced with a big problem: the shopping cart doesn’t create an RSS feed and you used WordPress to power the rest of the website. Now you have 2 separate components running one site: a flat file shopping cart and WordPress as a CMS , how do you get them to play nice? Are you a PHP programmer? (In my case sadly,no). Well if you aren’t a programmer you can still use wp-blogheader.php to do neat enough things like pull your WordPress theme’s navigation menu in the shopping cart header and your WordPress theme’s footer in the shopping cart, too. In the end you’ve worked really hard getting 2 very different PHP applications to look exactly the same. But you aren’t happy yet. You want some automation. You don’t want to make your clients work that hard.

WordPress is easy to use – my clients quickly catch on to how they can do pretty much anything with it and they can do it themselves.

But how do I get that shop content onto the homepage? Like, dynamically? The home page features their upcoming events and very carefully handcrafted (by me) Featured Products Posts that match the shop pages content in looks. But the whole point of this exercise was that my un HTML savvy clients be able to update their website themselves. I installed a few plugins to help them along such as Post Template . With this they can copy and paste image and page URLs, add some tags and a title and publish. But there is still all that damn HTML. I’d rather they not have to even see it at all.

Another thing is they sometimes run out of a product that was featured in a post on the home page. The product then pretty much ceases to exist in the shopping cart. When this happens and then someone follows the link in the Featured Product Post very bad things happen. Babies start crying and birds cease their joyful song. I’m kidding: the link leads to a page with a nasty PHP error printed on it.

Obviously the next step really was RSS. Or getting some sweet RSS action from a page that wasn’t putting out. I went looking for services like Page2RSS, Feedity and Feed4All. I looked at Dapper and Yahoo Pipes. On my Code page you can see an example of the use of Page2RSS and the MultiFeedSnap plugin displaying content from my client’s shopping cart.

Dapper was really neat (you can make flash badges!) so I am definitely not giving up on them but I didn’t get Yahoo Pipes. Feedity inserted ads in place of the product images and Feed4All just didn’t seem to work. So far my experiment has let me avoid classic screen scraping and I feel like I’m getting close to getting what I want. There are other plugins to explore, too. But MultiFeedSnap works pretty well I must add.

Have you had any clever triumphs in this arena? I’d love to hear about it.

WordPress as a CMS:Too Complicated for Clients?

It depends.
I’ve noticed that my clients are not big on selecting categories when they write new posts. And it is the rare client that pays any attention to Tags.But for the average client I would not recommend setting up a site that needs Custom Fields. Categories, yes. Categories are far more intuitive and a much easier concept to grasp.If your client is advanced enough to use Custom Fields chances are they don’t really need you at all!

But for the average client,if I have set up a site that depends on the correct selection of categories before publishing, I have to teach them that they must select the right category when writing a new post.If they get it (and most of my clients do get) it works.
Using WordPress as a blog does not depend on picking the right category. Because all posts get looped by index.php whether they are in category 3 or category 1003. But maintaining a site that is using WordPress as a CMS and a blog requires playing by some simple rules.

WP as a CMS, 2 Blogs in One
Here is an example of WordPress as a CMS that might be considered “too complicated” for some clients to upkeep. This site has a home page template using one version of index.php and a simple custom query to show only Featured posts. While another template loops only the Events posts. For this site I kept it very simple by creating only 2 categories. By keeping it this simple and knowing that my average client does not tend to create new categories just for kicks fingers crossed, this will be an easy site to maintain.

How to get 2 “blogs” in one. One “blog” on the frontpage that shows only one category and another “blog” that will use one master category to show all the other posts.
I left Reading settings as “Frontpage displays: your latest posts”. I wanted those latest posts to be from only one category. And then I wanted to exclude these posts from the other “blog” and vice versa. The question was use a category template or use a custom query in a template? I’ve used both and it’s my opinion that category templates are the better way to go.

Using a custom query
Trying to get posts in a template from one or 2 categories using a custom query breaks the next post navigation. This means you either have to set your Reading settings to show 100 posts or to use the showposts=100 in the custom query. It’s not that elegant. And I always felt it was a broken but working kind of way to use WP. Meaning it sort of does what you want but not really.

Using a category template
To use a category template all you have to do is copy your index.php and rename it category-1.php.
In this project’s case, category 1 is the Events category which is the second blog and is going to be used as a “real” blog. Upload category-1.php to your theme folder. That is all you have to do.How does WP know to use this file? When it comes to categories WP is set up to look for a category template first.

How to keep posts belonging to category 1 out of the front page?
Paste this in the template you are using for the Featured posts to keep category 1 posts out of the front page:

<?php query_posts($query_string . "&cat=3,-1"); ?>

code explanation
Category 3 is the Featured Posts category that I do want on the front page. Category 1 has a minus before it because I do not want posts from the Events (category 1) showing upon the home page.The template for the Featured posts is the main index.php file.The template for the Events Posts is a copy of the main index.php file.


How to keep posts belonging to category 3 out of the Blog?

Because WordPress will show posts from a specific category if you use a category template only posts from the Events category will show up on the blog pages. So you don’t have to do anything extra to this template.

Navigation
If Categories are the backbone of WordPress then Navigation is the backbone of your website.
(Many ready made themes already provide this in header.php ) but are set up for WordPress to be used as a blog so they probably include a link to Home and then add in the code below as well. But if you write a page called Home “Home” will then show up twice in your menu–which you probably don’t want.I find it is easier to include or exclude pages from my top navigation rather than hand coding in a link to pages. Here is how to include or exclude:

<ul id="nav"><?php wp_list_pages('sort_column=menu_order&depth=1&exclude=12,16,18&title_li=');?></ul>

code explanation
What this does is build a navigation menu of your pages while excluding pages with ids 12,16 and 18.
Excluding pages from the top menu is easy– all you have to know is the id number of the page you would like to exclude.This code will not show child pages.*

If you need a category title to show in your navigation you can do this:

<ul id="nav"><?php wp_list_pages('sort_column=menu_order&depth=1&exclude=12,16,18&title_li=');?><?php wp_list_categories('sort_column=name&title_li=&exclude=3'); ?></ul>

code explanation
Now your menu will show all your pages and at the end will show the Events category but will exclude the Featured category.

This does have it’s drawbacks.There is a limit to how many tabs you can have in a horizontal menu without going 2 tier. If my clients don’t add new categories doesn’t mean your client’s won’t.

So another way to insert a tab for the Events category would be to do this:

<ul id="nav"><?php wp_list_pages('sort_column=menu_order&depth=1&exclude=12,16,18&title_li=');?><li><a href=" <?php echo get_category_link($category_id=1);?> ">Events</a></li>
</ul>

Of course this has it’s drawbacks, too. It will make sure your menu doesn’t get overcrowded with category tabs but it will only create a tab for the Events category. If there are child categories of the Events category they will not be displayed in the list of posts. (**Not True!-Yay**)Still, this might be the best way to go. You can show other categories in a sidebar or use a query to show the child categories in the Events category template. Or you can use Yet Another Related Posts plugin (YAPP) or similar that creates a list of related posts using parameters.

Any site you hand off is going to require some attention from you.If you know you won’t be able to give your time try to set up the website accordingly. Don’t expect a client to get it right away. Be prepared to repeat instructions.

*This plugin will create a dropdown on any page with child pages:Multi Level Navigation .It should be used to replace your current menu so pay attention to the Advanced options.You will have to play with the css a bit but they also provide a css generator.

How to use WordPress as a CMS part 3

In the past 2 posts I covered the menu and how to set which page will be the home page.

And here is how to have a custom home page with dynamic content. A static page is not the best thing for a home page because it’s just kind of dull– a freshly updated and interesting home page is more exciting, better for SEO, better for site visitors. It’s the home page, after all. It’s usually the 1st thing people see when they land on your website.

I got the idea for this while working on an ecommerce website where we weren’t going to be showing the blog on the home page but still wanted to show some stuff from the blog. We created a What’s New , category, assigned posts to it and they showed on the home page. We didn’t end up using it but it was a bit of work to figure out so I wanted to pass it on.

Show 3 excerpts from a single category in a custom home page template:

<?php $more = 0; ?>

<?php query_posts('cat=2&showposts=3'); ?>

	<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div class="post" id="post-<?php the_ID(); ?>">

<h2 class="post_title"><?php the_title(); ?></h2>

 <div class="post_category">Posted in <?php the_category(', ') ?></div>

                <div class="post_comments"><?php comments_popup_link('No comment', '1 Comment', '% Comments'); ?> <?php edit_post_link('Edit', '', ''); ?></div>

<div class="post_datetime"><?php the_time('F jS, Y') ?> at <?php the_time('g:ia'); ?></div>

	<?php if (is_search()) {

                            the_excerpt(); 

                        } else { 

                            the_content(__('Read the rest of') . "\"" . the_title('', '', false) . "\" &raquo;"); 

                        } ?>

Ok, if you copy and paste that you’ll break your page because the divs aren’t closed and neither is the Loop.
I’ll try to explain what each bit does.

<?php $more = 0; ?>

makes sure the more tag can be used in the Page template, since the more tag is reserved for Posts.

<?php query_posts('cat=2&showposts=3'); ?>

pulls the latest 3 posts from category ID 2

Some things may go awry:

Your client may forget which category is going to show on the home page.

That’s why it’s a really good idea to walk them through the dashboard and explain the whole category thing to them.

Also, name the category something like Home Page News so they will be more likely to recall this is the category for displaying post excerpts on the Home Page.

<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>

good old Loop

<?php if (is_search()) {

                            the_excerpt(); 

                        } else { 

                            the_content(__('Read the rest of') . "\"" . the_title('', '', false) . "\" &raquo;"); 

                        } ?>

bit of code to show content as an excerpt if it’s a search.

relies on the person writing the posts remembering to put in the more link and choose the right category for the posts.

This template is only an example – you have to change the names of the divisions to match the names in your theme -so the stylesheet can work- and make sure they’re all closed. That means checking the header and footer, too. And you’ll want to change the category ID to one you want to show.

download template