Recently I’ve been delving into customising both Wordpress and Drupal and although I’d consider myself still a beginner, I still think it’s worth writing about problems I’ve encountered so others learning Wordpress & Drupal customisation, can do it without the same frustrations.
So today I’m going to talk about how I needed to include a post category on a post page. A client required each post to have a header above the post with the posts category name nicely styled with CSS above the post. After a read though the Wordpress documentation and some experimentation, I ended up with the the_category tag and what I thought would be the solution to my problem.
Unfortunately, this wasn’t entirely correct as the_category tag causes the category name to be a link text as well which wasn’t what I wanted. So I dugg around the Wordpress docs and forums to try to find how this could be done. It wasn’t long before I found others looking for the same solution and responded to their own problem post with… ‘it’s ok, I’ve worked it out’. That’s right… they didn’t put how they solved the problem which is why I couldn’t resist writing about this. So here is the solution…
Instead of using the_category, you use get_the_category as follows
<?php
foreach((get_the_category()) as $category) {
echo $category->cat_name . ' ';
}
?>
get_the_category tag comes with other objects that are available from the array.
- cat_ID – category id
- cat_name – category name
- category_nicename -post slug
- category_description – category description
- category_parent – the current categories parent category id
- category_count – the number of uses of this category
You can find more information at the url below.
http://codex.wordpress.org/Template_Tags/get_the_category
Whilst looking back in hind sight, this seem pretty obvious… when your trawling through documents, blog posts, forums, you find yourself missing the critical piece of the puzzle. Hope this helps…:-)
Robert Wordpress Customisation customising wordpress, get_the_category, the_category
If your looking at doing a ruby on rails installation on your Mac, make sure you understand where all these new applications are being installed on your system and how to make your rails installation unbreakable.
Many developers from beginners to advanced are trying ruby on rails. If your like me, you’ll be doing most of your rails coding on a Mac. If you were a Windows user who has recently switched to the Mac for Rails development, you might find the amount of terminal usage in Rails development a little intimidating.
A few years ago, I was lucky enough to work with a corporate company running UNIX so I had the opportunity to learn enough UNIX basics to be reasonably comfortable working with the terminal and the command line in Mac OSX.
If your installing Ruby on Rails on your Mac, then Dan Benjamin of Hivelogic has the best tutorials to get the installation done right. Dan really knows his stuff when it comes to that sometimes terrifying terminal, so you’ll find his installation guides a breath of fresh air.
Before you start that rails installation, I encourage you to read Dan’s article on setting your applications to install in usr/local rather than the default. The more you understand about why things are done the way they are, the easier you’ll find the rest of your rails experience.
Robert Development Unix
Wow, I have to say that this is a pretty cool deal. Sitepoint is giving away for the next 60 days a FREE, that’s right absolutely free copy of Patrick Lenz Ruby on Rails Web Applications book.

Patrick has been in the web development business for year and is the CEO of development firm limited-overhead.
So is there a catch with the book being free? Well no but you will have to complete a form to add your email address so you can be sent a link for the book. If you don’t like being subscribed, you can always easily unsubscribe later.
Well worth the download. Go get em cause time is ticking!
Robert Ruby on Rails Ruby on Rails, Tech Books
Did you know that you can use CSS to create text shadows? Well I think it’s a pretty cool thing that CSS allows you to do if you just want to give your page headings a subtle lift instead of just a boring flat text heading. So why not just use a graphic to give the same effect? Well it’s pretty common knowledge that text heading are better for search engines and can easily be tagged with the appropriate html so using CSS to create the subtle shadow is a win-win for you and your site users.
The way it works is by applying the property text-shadow to your selector ie: h1. Here is a you could write your CSS.
h1 { color: black;
text-shadow: #ccc 2px 0.2em 3px;
}
The values in the text shadow property example above are #ccc which defines the colour of the shadow, 2px determines how deep the depth of shadow, 0.2em defines how far right (or left using negative values) the shadow will be, and the 3px defines the amount of blur to be applied.
Here is a sample of how text-shadow looks providing your browser is capable of rendering the text-shadow property. Firefox, Opera & IE6 & 7 all don’t render the text-shadow property, however Safari for Windows & Mac work great.
This would produce a nice drop shadow on your text heading just giving to give you the effect that your headings have a little depth to them. The only downside to the text-shadow property is that it doesn’t work on browsers that aren’t CSS2 compatible but we should be seeing more of this kind of thing as browsers improve and add more CSS functionality.
Robert CSS CSS
Ever wondered if you ISP is providing you the amount of bandwidth that they claim they do? Well recently I needed to upgrade my broadband plan to include more download and faster speeds. My ISP here in Oz is Telstra Bigpond… somewhere back in the archives I did say I was going to dump them but never did… Well the cable plan I’m on now boasts up to 30 Mbps, however there are a number of factors that Bigpond say may affect performance, like location, the bandwidth of the site you are downloading from etc, you get the general idea.
So I decided to test my bandwidth using Speedtest.net and on my iMac using the built in wireless and I got the following result. I managed to get up to 5131 kb/s out of a possible 30000 kb/s. Although the speed is pretty reasonable it’s not that good compared to what is available.

I figured that maybe the wireless connection on my iMac could be part of the problem. So I fired up another box I have that is wired directly to the router and got the following results.

Wow, just by plugging in directly to the router, I was able to manage another 4000 kb/s. So it seems that these factors claimed by Bigpond might just have some substance. In any case 5000 kb/s is still pretty good in my book and 30 Mbps is a good marketing strategy by Bigpond even though you may never ever see it.
How good is your ISP?
Robert Internet bandwidth, bigpond, Internet, isp, speednet, telstra
Recent Comments