How We Built a Game Portal Faster Than You Can Say "Gambrinous Games Rulez, OK".
In Part I, we announced the launch of our brand new game portal, GambrinousGames.com. I'd like to take a few minutes of your time to talk to you about how we launched our portal in record time, and how this same process can be quick and painless for you too. Gather 'round everyone and let me guide you through our journey to Game Portaldom.
What were we trying to achieve?
As mentioned in Part I, what we wanted to build was slightly different from the usual. Rather than grabbing an RSS feed from somewhere like Kongregate and re-publishing everything they publish, we wanted to hand-pick our favourite games and just publish them. Quality over quantity; unless you're talking about cupcakes.
Naturally we still wanted all the normal things that game portals do (categories, RSS feeds of games, ratings, comments etc). Both of us being programmers, we considered writing our own game portal software for, oh I don't know, maybe 6 seconds? We ultimately decided against this because it would take too long and maintaining the code would be a bit of a nightmare (seriously, you have never seen my code).
We took a look at the portal software that was already out there. The two main players were Arcadem Pro and PHPAS. They both had some neat features alright, but overall the solutions seemed too messy. They did way more than we could ever want or need, and it really just seemed like way too much effort to apply our own design to either theme. In our search for simplicity and flexibility, it turned out we had been looking at the solution every time we visited this blog.
WordPress: The Unlikely Hero
WordPress is a blogging platform that I'm sure many of you are already familiar with. It powers millions of blogs all over the Internet, but we were able to take many of the features it offers and use them to build our portal.
So, what makes it great for a game portal?!
Our basic need was simply to publish games that we had hand-picked from various sources, and include a few details about the game and our own mini-review. We thought about it for a little while and realised that the process of publishing games for the portal was very similar to how we published out blog posts. The features that WordPress offered also made many aspects of managing the portal a lot simpler.
- RSS Feeds: WordPress automatically creates RSS feeds of content published through it, so we had a ready-made feed where people could subscribe to see game releases right in their feed reader.
- Pretty URLs: They're nice to look at and it's easy for users to remember them. Google is pretty fond of them too. All these factors make games on the portal a whole lot easier to find.
- Scheduled Posts: This one's a beauty. You could spend one night queueing up your planned releases for the next couple of months and then fly out to the Bahamas while WordPress sits at home in the rain, busily publishing out your games just like you told it to.
- Comments: WordPress makes it very easy for your users have their say about each game that you post.
- Categories & Tags: It's super simple to add games to specific categories or tag them with specific keywords straight out of the box.
A little help from our friends
Of course, WordPress didn't bow to our every command straight out of the box. We wanted our users to be able to rate the games that we published, and, being the Twitter nerds that we are, we wanted to announce the launch of each game via Twitter on our dedicated Gambrinous Games feed. Luckily, all of these issues were easily rectified by the vast WordPress developer community. We added the following plugins to help us along the way:
- Twitter Tools: A nice a simple plug-in that will automagically add new posts to Twitter.
- WP-PostRatings: Add ratings to each post in WordPress. It also has a nice feature to allow you to customise what information gets displayed around the star ratings.
- Akismet: This comes with WordPress and is a must for any blog that accepts comments. It will filter out all those nasty Viagra ads.
Already at this point, we had the bones of our game portal. There was one more feature in WordPress that came in handy, and that was Custom Fields. There was certain information that wasn't easily conveyed through WordPress' default functionality or through plug-ins. Certain things like setting the width and height of the flash game or setting thumbnails and screen-shots of each game we publish.
To get around this, we added a few custom fields to our blog posts for each piece of information that we needed, then added it to our WordPress theme where required. It really was remarkably painless.
The Science Bit
We brought everything together in a WordPress theme. We took the default Kubrick theme and modified it to fit our needs. The excellent WordPress Codex served as our guide throughout this process, required reading if you're going to be making your own templates. The first thing you need to understand is the anatomy of a WordPress theme. All themes are stored in individual folders named after the theme. If you created a theme called "My Super Game Portal", it would be found here:
Another handy feature of WordPress themes is the functions.php file. Simply create a file called functions.php in your theme folder and add any custom functions to it. Everything you put in there will be available to your theme automagically. We have custom functions for pulling our top rated games and our newest games out of the database.
The final technical detail you really need to know before being able to customise your own WordPress theme is how to use those custom fields I mentioned earlier. One way we use the custom fields is to set the width and height of each game that we publish.
To use these fields in our template, we simply use the following code on the game page (single.php):
echo get_post_meta($post->ID, 'game_width', true);
echo get_post_meta($post->ID, 'game_height', true);
That should be enough to get you started. For more information, you should check out the Theme Development article within the WordPress Codex.
Finally and in Conclusion
So, that's how we did it. It was quick and simple, and all made possible by our new friend WordPress. What are you doing still reading? Go and use WordPress to build that game portal you've been talking about for the last 2 months!
This article originally appeared on MochiLand.com. A special thanks to Ada Chen and all the great guys over on MochiLand.