Rydz Design: The WordPress stuff part 1

I said a while ago that I would write about the WordPress development that went into the making of this site. It then crossed my mind that it may be a bit too much for one article, forcing me to summarise a lot and skip over the details, so I’m going to break it down into a few articles.

The first thing I want to say is that this entire site is powered by WordPress, from top to bottom, front to back etc. The notebook, portfolio and every single page is all managed from the admin area. I managed to configure the site with so that posting to the blog or portfolio would be simple.

The obvious way to do this is to separate notebook articles and portfolio pieces into two categories which I did. I then set up a page to display each category using query_posts.I ran into two problems. Firstly I wanted to use a variety of categories for the notebook and pagination wasn’t working on either of the pages.

The category issue was very simple. I made sub categories and excluded the parent category (notebook) from any archive lists/recent posts etc. This meant I could categorise my writing to my liking.

The pagination proved a little more tricky. After quite a lot of googling I stumbled across various pieces of information that I managed to piece together in order to achieve my goal. Here is what I did:

<?php
        if(have_posts()) :
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        query_posts("category_name=Notebook&posts_per_page=5&paged=$paged");
        while(have_posts()) : the_post();
?>

With this in place the next page/previous page links worked perfectly.

That’s all for now. In my next article I hope to write more about how I use WordPress as a CMS as opposed to a simple blogging tool. Just a side note. The book, Digging into WordPress has proved invaluable to me whilst developing this site. Get it now.

Leave a response

Comments are closed.