How to use jQuery in WordPress Themes
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 to “enqueue” such scripts before the closing head tag (and before wp_head() is called). This is done in your theme’s header.php file: wp_enqueue_script(“jquery”); Every...
read moreHow to detect screen width in CSS
Have 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. CSS Rules: iPhone & Co. iPhone screens are 320 pixels...
read moreHow to disable update notifications in WordPress
Sometimes “new” doesn’t always mean “better” or “suitable”. Sometimes we require older versions of plugins and I’d rather WordPress would not tell me that there’s a newer version available. After all, I might accidentally update a plugin – or perhaps my clients do, breaking the site or overwriting customisations. Let’s take a look at how we can disable those notifications, both for single plugins and for the entire site. Disable update notifications for a single plugin You can...
read moreHow to add a Custom Button in Plesk
Plesk allows you to create custom buttons to the control panel, complete with logo and URL. Since Plesk 11.5 you can even choose in which part of the panel your buttons shall be displayed. To do this, login as administrator and head over to Tools & Settings under Panel Appearance, choose Custom Buttons click Add Link to Service give your button a Display Title and enter a URL select an image (I find 100×100 works well) select where you’d like the button to appear from the drop-down You have several self explanatory options in...
read moreHow to display an RSS Feed in Plesk 11.5
One of the many new features in Plesk 11.5 is that you can customise the Panel appearance for your customers even more than before. For example, Parallels allow us to display any RSS Feed in the control panel in the right sidebar. Adding it isn’t as easy as it perhaps should be. In this article we’ll examine how to do it. Here’s what an RSS Feed looks like inside Plesk 11.5 How to we add a feed? I had expected this to be a simple copy and paste session inside Plesk Panel itself. But that’s not the case. You’ll...
read moreHow to fix permission problems when restoring folders from Time Machine Backups
I had an odd problem the other day: I wanted to restore a fairly large folder from my new AirPort TimeCapsule. But the restore always stopped at one particular file, with an error message about permission problems. The folder in question was about 4GB in size and contained just over 10.000 files in total. I was baffled! Time Machine had never failed me before, so what was going on out of a sudden? Well I guess it’s a computer, and things just go wrong sometimes. Thanks to Apple Support this problem is now solved – and I thought...
read moreHow to use yum-complete-transaction
Every once in a while it can happen happen that use use “yum update” to update your Linux system. Usually this works without a hitch, but you may have come across a message such as this: Setting up Install Process Resolving Dependencies There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. The program yum-complete-transaction is found in the yum-utils package. But what does this mean, and how do we alleviate this? This message means that yum didn’t quite finish...
read moreHow to mount additional disk space in 1&1′s Cloud Server
I’ve just ordered a new Dynamic Cloud Server with 1&1 with a total of 800GB disk space. They rock, but they come with a minor inconvenience: due to the way these server instances are allocated, 1&1 do not automatically extend the partition for you – so you can’t actually start using the full amount you’ve ordered. Here’s how to make use of the full disk space on a current file system: df -h shows all partitions we want to grow, in my case /var is mounted on /dev/mapper/vg00-var so that’s the one I want to grow pvs shows us how much...
read more