How to check which iOS version your device is running

We can check the UIDevice’s property systemVersion for this. Here’s a quick snippet that checks this, and conveniently checks the first number in the returned value. This should work until iOS 9… NSArray *versionArray = [[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@”.”]; if ([[versionArray objectAtIndex:0] intValue] >= 7) { // do this if we’re runnign iOS 7 or […]

How to fix “Dynamically-related files could not be resolved” message in Dreamweaver

Adobe_Dreamweaver_CS6_IconWordPress is made up of over 70 files which may be called to display your site. Dreamweaver has a handy feature with which it lets you discover all those files.

Sometimes this works great – and sometimes you get the error message above. I was stumped by this when a site I was working on seemingly threw Dreamweaver overnight. Was was going on?

The secret is Permalinks.

Dreamweaver has a problem discovering and resolving related files if you’ve set Permalinks to anything other than the default. This problem has been around for a while, ever since the introduction of this feature in fact.

Read more

How to remove a widget from the WordPress Dashboard permanently

widget-be-goneIf you want to never see a widget on your WordPress Dashboard ever again, just head over to the top where it says “Screen Option”, then simply un-tick the ones you don’t like.

That’s Zen Therapy right there. These preferences are saved on a per-user basis.

But what if you don’t want certain widgets to show up, because your client gets confused by all the dashboard clutter? I know I do!

Help is at hand: you can use a couple of neat functions in your theme (or plugin) so certain widgets never even show up. Let’s see how this works.

Read more

How to define Javascript Behaviours in Dreamweaver

Adobe_Dreamweaver_CS6_IconDreamweaver keeps on giving – and the more I’m looking into it, the more I like how it can support me. Today I discovered that you can define Javascript Behaviours without writing a single line of code.

This can only be good news – especially if Javascript is one of those things that always looks a bit scary.

Here’s how to make Dreamweaver create code that can hide an element, and bring it back.

Read more

How to change the WordPress Login image and URL

Screen Shot 2013-09-06 at 15.54.53There’s a great little plugin called Add Logo to Admin by c.bavota which does a great job at letting you add your own logo to the WordPress login screen, and even to the top of your dashboard. But it’s another plugin.

If you’re building a theme for a client and simply want to replace the generic WordPress image, you can do that with just a few lines of code. Place them in your theme’s functions.php file:

//Change the generic login image
function custom_login_logo() {
  echo '';
}
add_action('login_head', 'custom_login_logo');

Discovered in Jo Lowery’s excellent course Dreamweaver and WordPress Core Concepts at Lynda.com.

Read more

How to use jQuery in WordPress

On a standalone (non-WordPress) project you’d import the jQuery library in the head tag, then call a jQuery function towards the bottom of your file. This approach isn’t working in WordPress. Since jQuery and many other useful libraries are already part of WordPress, there’s no need to link to your own copy. Instead, you need … Read more

How to detect screen width in CSS

CSS-LogoHave you ever wondered how a website can look great on your desktop and appear reformatted on your phone? The secret sauce is done via CSS Media Queries.

In a nutshell you define your styles for larger screens, and then override those styles with more mobile friendly options if the screen is smaller. You can specify the exact width which allows even to detect if someone is holding their device portrait or landscape.

Let’s look at how this can be accomplished with CSS rules.

Read more