define('DISALLOW_FILE_EDIT', true); define('DISALLOW_FILE_MODS', true); Blog | WP Hosting

Blog

How to use custom CSS in the WordPress admin interface

Posted by on 4:22 pm in Knowledge Base | 0 comments

A bit related to my previous post about using jQuery UI elements in the WordPress admin interface, it’s likely that at some point you want to load your own CSS styles to your plugin or theme’s admin pages. Lucky for us that’s a lot easier that loading JavaScript! Here’s how – works without adding an action, anywhere outside your main function: // link some styles to the admin page $starterstyles = plugins_url (‘starter-styles.css’, __FILE__); wp_enqueue_style (‘starterstyles’,...

read more

How to use jQuery UI elements in the WordPress admin interface

Posted by on 4:04 pm in Knowledge Base | 0 comments

One thing I’ve been struggling with was to use jQuery UI elements in my plugins, for example jQuery UI Tabs. Even though the libraries are included with WordPress, I couldn’t get them to work. Thanks to Pippin’s Plugins I could figure it out – thanks, Pippin! My initial mistake was the way I created the admin page. WordPress provides so called wrapper functions that make creating an admin page very easy. For example, adding an admin page under the Dashboard works like this: // Add a new submenu under DASHBOARD using...

read more

How to hide Menu Options in the WordPress admin interface

Posted by on 3:33 pm in Knowledge Base | 0 comments

This is surprisingly easy thanks to a function called remove_menu_page(); To remove the Dashboard item for example, you can use the function like this: // remove Dashboard remove_menu_page(‘index.php’); The parameter is the filename of the item you’d like to hide. To find out what that is, simply hover over the menu options in the admin interface and watch URL your browser displays at the bottom. If your browser doesn’t display anything, click on the menu item in question and see that the URL looks like. The parameter...

read more

How to add drop down categories to Automattic’s P2 Theme

Posted by on 1:47 pm in Knowledge Base, Themes | 0 comments

You know I love P2. I always have, and I always will. It’s the perfect theme that turns my WordPress installation into a notebook site. Many users – me included – have often wished for the addition of categories to P2, so that when you write a post, you can add it to the category from the front page, perhaps via a convenient drop down menu. Here’s how to do it with P2 Version 1.5.1. And if you don’t want to hack the code yourself, I’ve got a full working project on GitHub that’s ready to rock....

read more

How to auto redirect to the front page after login

Posted by on 1:08 pm in Knowledge Base | 0 comments

Sometimes I’d like to go straight to my front page after logging in. This is extremely useful with themes like P2 which allow you to post from the front page, but may also come in handy if you don’t want your users to be put off by the admin interface. There’s a very effective solution built right into WordPress. Usually you’d login with something like this: http://yourdomain.com/wp-admin This in turn is a shortcut that really calls the actual php file: http://yourdomain.com/wp-login.php To redirect to the front page...

read more

Introducing The P2 Header Ad Plugin

Posted by on 7:09 pm in Knowledge Base, Plugins | 0 comments

I always loved Automattic’s P2 theme: it’s one of the most innovative ideas for blogging I could find. I’m using it on several of my notebook websites, including this one. I’ve been tweaking P2 for quite some time, and one thing I wanted to do is display an advert inside the P2 header. As you may know, P2 doesn’t like child themes very much, so I wrote a future proof solution as this handy plugin. P2 Header Ad let’s you display an advert of your choice inside the header. And when the theme is updated, your...

read more

How to fix “ibtool failed with exit code 255″

Posted by on 3:00 pm in Knowledge Base | 0 comments

I got this error message recently on a project that worked fine when I tried last (WordPress for iOS). The error didn’t make any sense, and no matter what I tried the app wouldn’t compile anymore, always stopping with the following error message: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool failed with exit code 255 I can imagine Xcode gets confused at times, as I currently have Xcode 4.6.3 and Xcode 5.0 installed, and I use them both (though not at the same time). A quick...

read more

How to centre an image in CSS

Posted by on 3:47 pm in Knowledge Base | Comments Off on How to centre an image in CSS

Centering text in CSS is relatively easy. All you do is add the “text-aling: center” property. If you’ve ever tried this with anything that isn’t text you’ll have noticed that this approach doesn’t work. Instead, display your class as a block, then set the margins to auto. You also need to specify a width so the rest flows around this fixed parameter: .yourclass { margin-left:auto; margin-right:auto; width: 400px; display:block; } This approach works with everything that is not text such as images. Thanks...

read more

Introducing Zen Dash

Posted by on 6:18 pm in Knowledge Base, Plugins | Comments Off on Introducing Zen Dash

It is my pleasure to share with you my latest WordPress Plugin: Zen Dash. It allows you to selectively hide those Dashboard Widgets, Menu Items, Update Notifications and even Footer Links. Inspired by Joseph Lowery and my recent post about how to do this in code, I wanted to create the same functionality without users having to use code. After a few days of coding I really got into it and added several other features, including some nice jQuery UI tabs. Under the hood is the same code I’ve described in my aforementioned article, coupled...

read more

Disk Space Pie Chart – Version 0.5 released

Posted by on 10:56 pm in Knowledge Base, Plugins | Comments Off on Disk Space Pie Chart – Version 0.5 released

I’ve just released a small update for my Disk Space Pie Chart plugin for WordPress. The new version addresses the following minor issues: Fixed Division by Zero bug (Thanks, Jure!) Tweaked some colours to better blend with WordPress Core Added MySQL Server Version The update was inspired by Jure di Mephit who very kindly gave me a tip on how to fix a bug in July last year… I didn’t find the time to write that update until now. Hey, better late than never. Thanks again, Jure Find more info about the plugin here, or download...

read more