It's been one of those days...
July 09, 2010 Comments
Living on a pale blue dot
July 04, 2010 Comments
Adding Facebook's Like button to your WordPress blog is as simple as adding a few lines of code to your theme. There are quite a few plugins available, but in my opinion, most of them are overkill.
You'll want to start off by setting up a new application on Facebook. This is where you'll acquire the Application ID used below. When you've completed this step, add the following snippet to your theme's footer and replace APP_ID
with your new Application ID:
<div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: 'APP_ID', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script>
Now add the following PHP snippet to your post template. I prefer not to have the button show up on pages, so they've been excluded in this example:
<?php if(!is_page()) { ?> <fb:like href="<?php the_permalink(); ?>" layout="button_count"></fb:like> <?php } ?>
There are several different ways to customize this, so have a look at the official Like button documentation for more information.
July 03, 2010 Comments
Since we generally want to keep mobile versions of websites lightweight, it makes sense to disable as much eye candy and JavaScript as possible. I personally use Lightbox 2 for image overlays and WordPress Mobile Edition to detect mobile devices. The two plugins obviously to not play well together. The easiest solution I came up with is to plop the following code snippet at the top of lightbox2.php
:
if(isset($_COOKIE["cf_mobile"]) && $_COOKIE["cf_mobile"] == "true") { return; }
This method can be used to effectively disable any plugin while browsing from a mobile device.
June 24, 2010 Comments
My new website, Pale Blue Dot, just went live. It was actually made on a whim over the past 20 minutes or so. I'm not really sure what my intentions are by putting up this new site, but I hope others out there will find it interesting as I do.
June 22, 2010 Comments
This guide is for anyone interested in learning how to contribute to the WordPress project.
Before beginning, make sure you have an account on Trac. This is the bug tracking software WordPress uses. The core developers have made it quite clear that any code submitted without a ticket will probably never see the light of day, so this is a critical step.
Once you've chosen a ticket from the queue, open up your terminal and check out the latest code revision (using Subversion):
mkdir wordpress cd wordpress svn co http://svn.automattic.com/wordpress/trunk/ . svn up
Make your changes and be sure to test them thoroughly. I personally prefer to develop in a private (offline) WordPress environment so there is no risk of anything breaking in production.
When you're ready to submit your work, generate the diff:
svn diff > NNNNN.diff # NNNNN is the ticket number in Trac
Now simply attach the diff to the ticket and describe the changes. Add has-patch
to the Keywords field and make any additional necessary comments. Try to be as clear and concise as possible.
This should be enough to get you up and running. Check out the official documentation for more information.
June 21, 2010 Comments
I just submitted my first patch to WordPress. The fix itself is actually quite trivial, but it feels good to contribute back to the community nonetheless. Hopefully the core developers approve and add it to the next release. :)
Here's the ticket: http://core.trac.wordpress.org/ticket/14035
June 21, 2010 Comments