GitHub is that awesome thing everyone says you’ve gotta use, but how many of us can make heads or tails of it? If you’re tired of pretending to understand when someone talks about “merging the latest pull request” or want to know what the heck forks have to do with code, this rundown’s for you.
I’ll show you how a little dose of science fiction is the key to understanding Version Control. There will be teleportation, time travel, there may even be a victimless murder as you learn the difference between a Fetch and a Pull, why Rebasing changes history, and how merging branches can magically reconcile conflicting code.
Whether you develop, design, or just care about content, Git, GitHub, and Version Control can be some of the most useful tools in your kit. After this primer, you’ll see why Git and GitHub is for everyone, including you.
Earlier this year I was honoured with the privilege of being the keynote speaker at WordCamp Seattle. The topic of my talk: Answer the question “Why WordPress”. My talk featured over 300 slides and took a look at the impact and importance of WordPress on the web over the last 10 years. Short synopsis: WordPress changed everything. In addition you get anecdotes, statistics, and a fair portion of nonsense and Vikings – exactly what you should expect. I’m not one to toot my own horn, but what I will say is that during my talk my handle @mor10 trended on Twitter, and there were people who claimed this was the best keynote they had ever seen. I’ll let you be the judge of that.
The presentation is 48 minutes long and contains one swear word. The slides are a little wonky in this video version but the important components come through clearly.
Watch it here or go to WordCamp.tv and take in this and all the other awesome presentations from WordCamp Seattle and beyond.
WordCamp Vancouver is returning to our fair city on August 17th. For the past two years I have been one of the organizers, but this year I am going to attend as a speaker and moderator instead. It’ll be a nice change of pace for me and it gives me an opportunity to share some insights about how I work with WordPress with the Vancouver community. Very exciting.
Can WordPress Really Do That, Take 2 – my talk
The title of my talk is, quite cryptically, “Can WordPress Really Do That, Take 2”. This talk is a follow up of sorts to a talk I did at WordCamp Victoria 2012 and will be a full breakdown of the process of building an extremely complex site. Since the site is still being built I’m not going to reveal what it is or what it entailed here (you’ll have to come watch the talk to get that info), but what I will say is that the talk will involve insights into everything from design, information arcitecture, working with clients, working with designers, managing unusual assets, to setting up custom post types, adding custom data points, importing enormous databases, creating custom searches and loops, and beyond. What can I say? It’s a complicated project.
Can WordPress Really Do That, Take 2 is a talk targeted at anyone working with WordPress professionally – be that as a content manager, a site owner, a designer, a developer, or all of the above. And yes, WordPress really can do that.
Running a WordPress Development Business – moderating a panel
The organizers have been kind enough to ask me to moderate a panel on running a WordPress business. This is going to be an exciting discussion with lots of valuable takeaways for everyone. The panel consists of four well established WordPress developers from Vancouver and beyond and I’ll make sure we get a lively discussion going about everything from managing clients to getting paid to hiring minions and building great sites.
If you have any questions, topics, or other things you want me to bring into the discussion, let me know either in the comments below or by harassing me on Twitter or sending me a message. The whole point of a panel discussion is for the audience to learn something new, so your input and participation is essential.
Come join the fun!
As of this writing there are still tickets available so whether you are a seasoned pro or you’ve just started looking at WordPress you should go get your ticket and join the fun. This is the event for our community, so go get your fill of WordPress and meet lots of new people who share your interest in open source and web publishing!
WordPress wouldn’t exist without the WordPress community, and WordCamp is where the community comes out to play. Over the past two years I’ve had the honour of being a co-organizer of WordCamp Vancouver (WordCamp:Developers in 2011) and in that role I’ve met a lot of very interesting people.
WordCamp conferences focus the attention on leaders in the WordPress community, both local and international, but as any attendee will tell you, the attendees can be just as interesting. To put this to the test I geared up and interviewed random WordCamp Vancouver attendees for my podcast. It all started with a simple ice breaker: “Tell me a story about WordPress”. Click the player above to hear the results.
Some of the peeps over at WordPress event calendar plugin time.ly came to WordCamp Vancouver last week and took the time to do an interview with yours truly about the value of the WordPress community and events like WordCamp and WordPress meetup groups. Check it out.
By the way, if you are in Vancouver and would like to talk to other WordPress enthusiasts you should check out the Vancouver WordPress Meetup Group.
If you are one of the thousands of people in Vancouver that use, work with, or interact with WordPress in your work life or private life, you need to attend WordCamp Vancouver coming up on October 13th, 2012. The event, hosted at BCIT’s campus in Burnaby, has speakers, workshops, and presentations that will blow you away and give you a whole new understanding of WordPress and what it can do.
WordCamp Vancouver is for everyone and you will find something for you whether you are a beginner or a seasoned pro. More importantly WordCamp Vancouver is an excellent opportunity to meet and interact with other WordPress enthusiasts, designers, developers, bloggers etc.
This is especially true for beginners: If you are just starting out with WordPress, attending WordCamp Vancouver will be the best decision you made (after deciding to use WordPress of course). I’m not saying that because I’m an organizer, I am saying it because it’s true. Ask anyone.
It all started with a simple yet befuddling question: “Can you create a WordPress site that sends SMS messages to users when things change?” My initial thought was that this could easily become the most annoying website in the world, but upon closer inspection it was a stroke of pure genius.
To ring in 2012 I’m bringing something completely different to WordCamp Victoria. If you’ve seen my live talks previously you know they are usually either neck deep in live code or conceptual presentations on theoretical ideas. This time will be different:
My talk, entitled “Can WordPress really do that? A case study of vierderduer.no” will be focussed around one of the most interesting and challenging WordPress projects I’ve ever been involved in, the building of a site called “Vi er der du er” (“We are where you are”) for Norwegian bank SpareBank1. I was brought on as an outside contractor by Netlife Research, one of the largest and most well renowned web dev houses in Norway, to make their crazy ideas and designs into a real-life site. I say crazy because this is a site that does things so far out of the ordinary even I have a hard time figuring out how we got where we are today.
What makes the site so interesting is that it uses Facebook Likes as a voting system to help raise money for organizations. The more likes an organization gets, the more money the bank gives them. And along the way the organization gets SMS messages telling them about the status of their application and how much money they have raised.
But that’s just the tip of the iceberg. This site has so many hidden features and backend customizations I’m not sure I’ll be able to cover them all in a measly one hour. But I’ll try.
The talk (which I have yet to prepare) will be a nice break from my regular stuffing-code-down-your-throat approach. I’ll talk about how the site came about, the many challenges and solutions implemented and how you can take my hard learned lessons and use them to make your custom WordPress themes more effective and easier to manage. More importantly though I’ll spend the hour helping you break free of the well established preconceptions about what WordPress can and cannot do. If you ask me there is no limit. And in this talk I’ll prove it.
So, if you haven’t already bought a ticket, head on over to the WordCamp Victoria site and grab yours. See you there!
Above is the slide deck for my WordCamp Victoria presentation entitled “10 WordPress Theme Hacks to Improve Your Site”. Unlike my regular presentation this one is entirely slides based which means if you just read the slides, you’ll get the gist of it. Below are all my code examples along with links to further information, example sites and related tutorials to give you some context. Knock yourself out!
Replace Site Title with a Linked Image
This is my number one pet peeve. When people visit a site they intuitively expect the logo or header image to be a link back to the home page, and it should be. When it’s not they (and I) get annoyed. Making your header image link back to your home page is not hard. All you have to do is wrap the header image code in a simple anchor tag that leads back to your root URL and you’re good to go. For simplicity the code looks like this:
The WordPress 3 custom menu function is built into the TwentyTen theme and most newer themes, but older themes usually just have hard-coded menus. Adding WP 3 custom menus to a theme is not hard though. It requires a function call in the functions.php file and a template tag in the template file of your choice (usually header.php and/or footer.php). Here’s that code:
Menus don’t have to be regular boring one or two word one-line elements. Because WordPress allows HTML in the Navigation Label you can add more interesting designs like we did on the 12×12 Vancouver Photo Marathon site. On this site we added a simple span tag around the text that displays under the menu heading and then used CSS to change how it displays. Sorry, no code examples – it’s just straight up CSS and out of context it makes no sense.
WordPress 3 Custom Background Images and Colours
The TwentyTen theme introduced a very cool custom background function built right into the admin interface (under Appearance -> Background). This is not a function found in TwentyTen but a core function found in WordPress. That means you can activate it in any theme. All you have to do is call it from the functions.php file:
add_custom_background();
The function injects CSS style code right into the HTML pages which means it’ll override your theme CSS file no matter what. That in turn is why it’ll work on any theme as long as you run WordPress 3.0 or higher.
Adding Featured Image (post-thumbnail) Functionality
Featured images are great, if you know how to use them. They also do way more than just displaying thumbnails (which is why I think the function should be renamed).
To activate the function add the following code to your functions.php file:
add_theme_support( 'post-thumbnails' );
This will add the function to you Admin panel. To display the featured image (in the size you want) in your theme use one of the following functions:
A custom category template can be made in one of two ways. Either create a file with the name category-ID.php where ID is the ID number of the category or category-slug.php where slug is the slug for the category. These files will automatically become the category tempaltes for the defined categories.
Custom Header, Sidebar and Footer
You can also create custom headers, sidebars and footers sort of the same way. You make and call them the same way. For example if you want a custom header you create a new header file called header-custom.php and then call it using the standard get_header() function with a small difference:
<?php get_header('custom'); ?>
where ‘custom’ can be anything.
Better Context Links
One of the things that bug me about standard WordPress themes is that they display links to the next and previous posts in the single post view. These links don’t really provide a lot of value. Instead you should be displaying the two latest posts from the current category. So I made a small theme add-in you can dump into your theme for some better context. The add-in adds links to the two latest posts in the current category including the title, publishing date and short description. To install it download the related.php file here (right-click and choose “Save As” – it’s a straight up php file), add it to your theme directory and call it using the following code in your single.php file:
Finally, after a full week of catching up, here is the video tutorial version of my presentation at WordCamp Whistler 09 for those who were there and those who couldn’t come. The video is also available on WordPress.tv if you’d rather watch it there. I recorded the video over the weekend and it contains the entire presentation including all my fancy slides as well as the code examples and demos. The only thing you won’t see is me waving my hands around and messing up the code like I did at the actual event ;o)
Code Snippets
The last half of the presentation centers around creating Custom Page Templates and Custom Fields for layout purposes. To help you along in your own WordPress site development, here are those code snippets ready to be cut and pasted into your templates:
Custom Page Templates in 5 lines of code
This block of code is inserted at the very top of the Custom Page Template file. To get started, simply open the page.php file, save it under a different name, paste these 5 lines of code at the top of the document, save and upload to your server. To activate the new Custom Page Template just select it from the Template menu under Attributes in the Page Editor within WordPress.
Custom Fields in one line of code
This code can be used in any template file including but not limited to page.php, any Custom Page Templates, index.php, archives.php, single.php etc etc. The code returns a string of text that matches the text inserted in the custom field. Remember to replace $key with the actual name of the custom field. You can read more about Custom Fields and how to use them in the WordPress Codex.
ID, '$key', true); ?>
Custom Field that parses PHP code
This code is used to parse (interpret) PHP code inserted into custom fields. It is a bit wonky – for instance it terminates any other custom field code placed directly after it in a page – so use it with caution. Otherwise it works exactly as the code above.
ID, 'centerBox', true); ?>
'.$boxContent); ?>
Applications Used in the Presentation
After the presentation several people came up to me and asked what applications I used, so here is a short list:
BitNami WordPress Stack
The demo site I used in the presentation was actually installed and running locally within Windows 7. To achieve this I used an ingenious application named BitNami WordPress Stack. Once installed this application will run a fully functional version of WordPress with database entry, plug-ins, custom themes and everything else you want to throw at it right inside Windows (XP, Vista and Windows 7 supported) so you don’t have to keep uploading your files to a server or hassle through complicated XAMP installs to play around with WordPress while offline. You can even install several different WordPress and other open source CMS stacks on your computer simultaneously to further increase your productivity. I have no idea exactly how it works but BitNami works incredibly well. Just remember to set the IP address to “localhost” when you install it.
You can download the BitNami WordPress Stack here. For Mac users there is a similar application called MAMP but I know nothing about it.
Web Developer Add-On for FireFox
FireFox is my absolute favourite browser and I use it for browsing as well as in the design process. One of the main advantages of FireFox is the myriad of add-ons you can install that make web site development a lot easier. The one I use the most is the Web Developer Add-On. This small application within an application lets you see and mess with CSS, turn styles and JavaScript on and off and do tons of other stuff that makes it easier to dissect and troubleshoot buggy web pages. Combine it with the HTML Validator add-on and you have a true powerhouse in a small browser window.
Microsoft Expression Web 2
My web development platform of choice is Microsoft Expression Web 2. This new offering from Microsoft is what enables me to build custom WordPress themes and web sites like AnnyChih.com from scratch in less than 24 hours. There are many great things you can talk about with Expression Web 2 but for WordPress theme development the two main features is full PHP support, unrivaled CSS integration and Standards Based CSS generation right out of the box. If you want to know more about Expression Web 2 or want to learn how to use it you can read more on this blog or pick up a copy of my book Sams Teach Yourself Microsoft Expression Web 2 in 24 Hours. It’s a good read, I promise.
Here are some code snippets from my WordCamp Whistler presentation. This article will be expanded in the coming week but in the meantime here they are for anyone wanting to play around with them: