Posted on : 30-05-2009 | By : Japh
The new Satellite website is now live!
If you don’t already know, I recently started full-time freelance development. The idea is that anyone who needs development work done, wherever they are, can contact me to help out on their project.
Whether you are a freelance designer who needs some development done (or even some training), or a freelance developer who needs an extra pair of hands, or even a bigger business who needs to bring someone else in on a project… I’m available for hire!
I would love to hear any feedback on the new website too, so feel free to leave any comments in that regard as well.
Posted on : 19-04-2009 | By : Japh
Everyone wishes they could get rid of IE6, and now there’s a nice, elegant way to prompt users to upgrade! The website for IE6Update provides a snippet of code to place between the <head></head> tags on your website, which will then trigger a small warning bar on users of IE6 prompting them to update to IE8.
I liked the idea so much, I decided that rather than simply copy their code snippet for my website, I’d make a handy little WP Plugin I could install on any of my sites. Save me editing themes etc!
If you want the plugin, here it is: Download
If you want to know more about IE6Update, you can read their blog post about it Announcing IE6 Update – Help kill Internet Explorer 6
Update: The download link above now points to the WordPress official extensions directory for download.
Posted on : 02-04-2009 | By : Japh
If you’ve been using WordPress for a little while, and don’t really much like the default options you have to choose from when a commenter doesn’t have their own Gravatar, why not make your own?
Make yourself a little square image to use that matches in with your theme, and then insert the following line of code:
<?php echo get_avatar( $comment, 86, 'http://example.com/custom-default-av.png' ); ?> |
Note: you must provide the full absolute URL for your image.
What this line does, is show a Gravatar for the user if they have one, and if not, show your custom one instead. The number “86″ is the pixel width and height you want the Gravatars to display at.
Remember that this will only work in WordPress 2.7+, or possibly in older versions if you have the Gravatar plugin installed (not tested).
Update: If you don’t know what a Gravatar is, check out the comments. The avatar’s shown beside each comment are automatically pulled in from Gravatar’s service, so you upload your avatar once, and it appears everywhere when you comment etc. Get yourself one here: Gravatar
Posted on : 31-03-2009 | By : Japh
Have you ever wanted to load a specific stylesheet depending on what time it is? It is actually very easy to do!
View Demo
I’m using jQuery in this just because it makes it look a little simpler, it’s not much more complex to do without jQuery… but let’s face it, you’re probably already using jQuery anyway, so why not
Make yourself a new file to put your javascript into, I’ve called mine “script.js”. Include the new javascript file by putting this line in your HTML <head></head> section with the following line:
<script type="text/javascript" src="script.js"></script> |
Now open your “script.js” file, and put the following lump of code into it:
// This line depends on jQuery, and tells the browser to kick off this stuff once
// everything's fully loaded
$(document).ready(function () {
// These two lines make set a Date variable with the current date and time
var currentDate = new Date();
var currentHour = currentDate.getHours();
// Here we're creating a new <link /> to insert in the <head></head>
var newCSS = document.createElement('link');
newCSS.type = 'text/css';
newCSS.rel = 'stylesheet';
// This is where you can determine when to use which stylesheet.
// If the current hour is before 9am or 8pm (or later), use "night.css"
if (currentHour < 9 || currentHour >= 20) {
newCSS.href = 'css/night.css';
}
// Otherwise, use "day.css"
else {
newCSS.href = 'css/day.css';
}
// This line actually does the deed, and attaches the selected stylesheet
$("head").append(newCSS);
// This line isn't necessary, it's just showing the actual time in the demo.
$(".satellite").html(currentDate.toTimeString());
}); |
Read the commenting to understand what’s actually going on there, but that should do it! Easier than you thought, I bet
If you have any questions or suggestions, leave a comment!
Posted on : 19-03-2009 | By : Japh
Have you ever seen that in shopping centres when a new store is moving in where an old store used to be? I liked it, thought it was clever, and now I’ve used it!
So I’ve decided to shift to a different domain name, and have (again) re-skinned the blog. This time, I think I’ll stick with it. Maybe a few tweaks here and there. I also hope to blog a little more, and do a few guest posts around the place, which I’ll link to from here as well.
While I’m here, I might just tell you about an iPhone app I recently tried and love. It’s called Instapaper and it’s fantastic!
You’ve possibly already heard of it, but if you haven’t, I suggest you give it a try. I read quite a few different blog posts around the place, some from feeds in Google Reader, and some that people link to on Twitter. More often than not though, I’m not in a position to read a full article right at that moment, and this is where Instapaper comes in. What to do when I’m lining up to use the ATM, or sitting in a small room contemplating life? I could read those articles!
Instapaper provides a bookmark you can use to say “Read later”, and it’ll save the page (in a readable format) to your Instapaper account, which you can then open on the iPhone. The big bonus for me, is that it actually downloads the articles to your phone, so even if you have no connectivity you can still read them (assuming you sync while you still have a connection). Considering the coverage some of the networks local to my area have, this is a particularly awesome feature.
Keen to hear your thoughts, both on Instapaper, and the blog in general, so feel free to leave a comment.