4 things I learned making Wordpress into a CMS
I recently had the awesome experience of making Wordpress into a small website for a client and it taught me a lot of things both for coding the theme and making the clients life easier. I’ll go over what I think are the five biggest things I learned.
Widgetized Sidebars (Dynamic Sidebars)
This was the single biggest help to me. The site design called for a links area at the bottom to link to other groups and departments and organizations related to this one. It also called for contact information at the bottom.
The solution is to use widgetized “sidebars” and then tweak the css to to turn your sidebar into a footer. To add a sidebar insert this code into your functions.php file in your theme.
<?php if ( function_exists('register_sidebar') ) register_sidebar(1); ?> </php> You can repeat this code for as many sidebars as you need. Just make the "1" into a different number. <span id="more-397"></span> Now insert this code where you want your sidebar to appear. <pre lang="php"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?> <?php endif; ?>
This will make your dynamic sidebar appear. For me i just fixed the widths of the widgets and floated them left with this code.
#footer .widget{ width:290px; float:right; }
By setting the width of the widgets and floating them to the left of my footer I made an editable content area the didn’t interfere with the post or page structure using widgets and dynamic sidebars.
Custom Loops
For the site i was making there wasn’t going to be a blog but rather a news section and an events section so i needed to split the posts be category and query them individually.
<?php $news= 'category_name=news&orderby=date&order=DEC&showposts=3'; query_posts($news); // run the query ?>
This snippet created a new query called news ($news) grabs 3 posts from the news category and orders them descending by date. You then set up The Loop normally below this code. My completed loop looked like this.
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php if ( $news%2 ) { echo "<li class='news_even'>"; } else { echo "<li class='news_odd'>"; } ?> <h3 class="smallindent"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3> <p class="posted smallindent"><?php the_time('m-d-y') ?> </p> <div class="smallindent"><?php the_excerpt(); ?></div> </li> <?php $news++ ?> <?php endwhile; ?> <?php else : ?> </ul> <?php endif; ?>
Drop Down Menus
The clients wanted the website to have a drop down normally i would oppose it but they had quite a bit of content they wanted to put on the site. After looking around for several hours and testing various methods for dropdown menu. I found this, it turned out to be the holy grail I was looking for and cross browser to boot. and it worked out of the box with the markup generated by wp_list_pages function.
Simplify the Admin Panel
After the first meeting and training session I wanted a way to hide various parts of the admin panel that were going unused. The theme was stripping Wordpress back to the core. No tags, no need to manage categories, or the media library. The solution was wplite. This nifty plugin lets you disable panels in the admin screen. It also lets you limit the post metadata fields (i.e. excepts, post tags, page order, templates, slugs ect.) it turned out to be the magic bullet I was looking for the make managing the site simple and easy. It can even strip the dashboard so the default page is writing a new post.
The next challenge
the next large project I have is to rebuilding the ASDA website with wordpress. With all the bells and whistles and more. The current proposal is.
- Multi-author blog
- Post by email for the discussion mailing list.
- Possibly hosting an ezine
- membership directory for the group
- links feed
- member portfolios
I’ll be publishing more on the development of the site once the group who is designing it throws more at me to code and when we get more ideas.


















Michael Wender
November 7, 2008 at 3:32 pm
Nice roundup of the things you’re learning about WordPress. For about the past 1.5 years, I’ve used it almost exclusively for all of my client’s sites. Basically, I think of it as a base framework that I can build any type of site off of. Then, should my client want a “blog” or “news” section, “adding” it in is easy. ;)
Regarding your custom loops:
If you happen to use the next_posts_link() and previous_posts_link() functions on those pages, you may find that those links don’t work. Clicking on them will simply redisplay the first set of posts in the loop.
If that’s the case, rewrite your loops like this:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("category_name=news&orderby=date&order=DEC&showposts=3&paged=$paged");
Adding the $paged variable to your query_posts() call will restore that variable since the function wipes it out when you call it.
Additionally, in your quest for a dropdown menu, did you consider the Multi-level Navigation plugin?
Nice looking site by the way.
PS – In case you’re wondering how I stumbled across your site, I saw your tweet about this post at http://search.twitter.com
admin
November 7, 2008 at 4:07 pm
Thanks for the awesome comment.
Great to know that I can page custom queries like that. Might come in handy.
I did find that Multi-level Nav Plugin you mentioned but at the time it think it just looked way to complex to bother with and the other solution worked out perfect so never bothered with anything else.
links for 2008-11-07
November 7, 2008 at 11:30 pm
[...] 4 things I learned making Wordpress into a CMS | Upside Down City (tags: wordpress CMS) [...]
Tracey Grady
November 9, 2008 at 9:49 pm
Thanks for sharing the process you went through and the resources that you’ve found. I can see all of these being extremely useful to me with future projects, especially the custom loops.
Wordpress UK » 4 things I learned making Wordpress into a CMS | Upside Down City
November 10, 2008 at 5:18 pm
[...] 4 things I learned making Wordpress into a CMS | Upside Down City This entry was posted on Thursday, November 6th, 2008 and is filed under Wordpress News. You can [...]
introspectif
November 11, 2008 at 8:28 pm
Thanks for highlighting WPlite!
admin
November 12, 2008 at 9:07 am
@introspectif Hey it works perfectly and keeps clients out of trouble what could be better!
4 cosas que aprendí transformando Wordpress en un CMS
November 14, 2008 at 4:37 am
[...] artículo de upsidedowncity.net escrito por Gino y traducido por Sara Salazar para nerv. ) Blogs | Permalink | 0 | [...]
Delicious November 2008
January 3, 2009 at 2:22 pm
[...] 4 things I learned making Wordpress into a CMS | Upside Down City (tags: wordpress CMS) [...]
Hammed Kohistani
October 9, 2009 at 11:30 am
This article was alot of great insite, definitely learned some new stuff! I am writing a full book in it as well, blogintocms.com