Why Yes I Started Cycling (Again)

When I was younger I quite enjoyed going out on my bike with friends and generally messing around, racing each other from place to place (getting in the way of every pedestrian walking on the pavement), also pulling wheelies like you would at that age!

On Thursday I went out and bought myself a brand new bike that was actually the right size for me for a change, and started cycling again over the weekend with my younger brother Graeme. We racked up 4.5 miles on Saturday and 6.5 miles on Sunday.

Yes I’ll admit the hills are almost a struggle right now but they’ve yet to defeat me! ;)

In the short term I’m gearing myself up for a 22 mile Sponsored Cycle I’ll be doing with a few other members (brother included) on Saturday 19th March 2011 for Haddington Bowling Club to help raise funds; mainly for the Christmas Parties we started last year, we’d like to try and continue the trend for 2011 too! :) — Plus on a much more personal level, I’d very much like to prove some people wrong and make them eat their words!

I’ll keep you updated.

Hello Dell Inspiron 580

Aside

After what felt like ages since I ordered my Dell Inspiron 580, it finally arrived at the door today at 12:12PM! :) – If only you knew the full story behind it all, the order that arrived today was actually the replacement order Dell issued on Thursday 6th January 2011 after UKMail were asked to carry out an investigation because they’d lost a package somewhere, but it didn’t turn anything up (typical huh?) — I’m all setup now though! :D

Hustle: Series 7

Image

Ever since Hustle hit our TV screens back in February 2004 I have been a big fan and I'm glad to say that Series 7 is starting tonight at 9PM on BBC One! -- If you've ever watched it yourself, who's your favourite character? -- For me I like Ash Morgan, he's great! :)

Happy New Year!

I had hoped to be using my new Dell Inspiron 580 I ordered back on Tuesday 14th December 2010 but thanks to UKMail well I’m still waiting for it to be delivered, what a way to ruin the good reputation Dell has, and the start of the New Year! :(

Well I got in the door about 3AM after working a 9 hour shift at a Hogmanay Bash that’d been organised and decided to crack open a bottle of Pear Magners I’d had bought for me from a customer, can someone please remind me to take next year off? LOL

Happy New Year, All The Best For 2011

Anyway I’d like to take the opportunity to wish you all a Happy New Year, and wish you all the best for that 2011 brings. I hope it brings me my Inspiron 580 to be honest! :D I’d like to think 2010 was a good year for me, so expect plenty more posts and exciting stuff!

WordPress 3.1 Introduces Custom Post Type Archives

While development on WordPress 3.1 is still ongoing and we’ll probably not see the final release until nearer the end of the year, I thought I’d let you know about a cool new addition to Custom Post Types that Andrew Nacin (Core Developer) worked on!

Little Background Info

Around 5 months ago #13818 was opened requesting an Index/Archive option for Custom Post Types because the way WordPress works meant that /post-type/ would just 404 on you although /post-type/wordpress-rocks/ worked just fine.

Similar could be said about Custom Taxonomies and how they function which I brought up back in February on the WP-Hackers Mailing List – I don’t think I was popular in the community that month for sure? While it’d be a nice addition I know many would like (and shut me up) I have been informed more than once it’ll not happen!

Now For Some Code

If you’re new to Custom Post Types and the register_post_type(); function then make sure to check out an in-depth article Justin Tadlock wrote on the subject, I recommend you read it anyway! :)

In our functions.php file lets setup a basic Projects Post Type with the Archive active.

add_action( 'init', 'mcw_projects_post_type' );

function mcw_projects_post_type() {

	register_post_type( 'projects', array(
		'labels' => array(
			'name' => __('Projects'),
			'singular_name' => __('Project')
			),
		'public' => true,
		'show_ui' => true,
		'rewrite' => array(
			'slug' => 'project',
			'with_front' => false
			),
		'has_archive' => true
	) );

}

We’re looking at the has_archive argument which has been set to true which will turn on the Archive for this particular Custom Post Type, normally it would default to false though! — But we can take that a step further because when it’s set to true it’ll fallback to the value in the slug argument. So here that would make it site.com/project/ which just wouldn’t look quite right!

'has_archive' => 'projects'

All we did was substitute true with projects which therefore shows site.com/projects/ as being home instead. Now we know we can do that, we can do all sorts of things (get creative), we don’t need to keep it in line with our Projects Post Type.

'has_archive' => 'work'

Thinking outside-the-box gives you site.com/work/ which is different, the option is yours!

What Else Might I Need To Know

A new archive-{$post_type}.php template was introduced although it will fallback to archive.php if it can’t find the appropriate template for the job. So for our Projects Post Type, as projects happens to be the value we used for the Custom Post Type, we’d call our template archive-projects.php — Similar to if we used the portfolio value for a Portfolio Post Type we’d end up calling our template archive-portfolio.php and so on.

If you get a 404 error when trying to view the Custom Post Type Archive then simply visit Settings > Permalink which will flush your rewrite rules for you, it’s as simple as that, and there we have it!

Time For A New Computer?

Aside

For a while now I have commented on my PC doing stuff that I never asked it to, and in general just causing more problems than good, of which if finally stopped working last night! :( Which for people who use it for day-to-day tasks like myself, I wouldn’t like to think how much time I have wasted doing even the simplest of tasks? — Not to mention when it comes down to the specification, you’re speaking to the wrong guy here, I don’t know where to start (with a Core i7 Processor) or what I’m looking for?