Year: 2011

  • Implement a 404 image in your Theme

    Implement a 404 image in your Theme

    Every good Theme comes with a 404.php for requests that don’t match any post or page. But what to do with missing images? They are requested per an <img> element usually, your visitors may never see the HTML template. Let’s use a 404 image. I put the following code on top of my 404.php before…

  • Restrict Mime Types on WordPress Media Upload

    Restrict Mime Types on WordPress Media Upload

    WordPress has changed the library in version 3.3 – which I think is an improvement. The restrictions in terms of file types remains and you can control them via hook. So you can limit or extend the file-types. Via two hooks, this is done quickly and there is a notification displayed in your backend which…

  • Add Icon to Site Link in the WordPress Admin Bar

    Add Icon to Site Link in the WordPress Admin Bar

    Each button in the Admin bar has a self-defining and space-saving icon. But the link to the blog frontend (which is represented as a blog title), has no icon. If you want, you can change it quickly – here is a small solution.

  • Enqueue comment-reply.js – The Right Way

    Enqueue comment-reply.js – The Right Way

    Since Google takes the loading time of a page as a ranking factor, it is always important for a theme designer to incorporate the required resources correctly. In Xtreme One WordPress Framework our JavaScripts are loaded only when they are really needed. Do you have a slider widget on the home page, then the JavaScript…

  • unserialize() Error at Offset… Different solutions

    unserialize() Error at Offset… Different solutions

    The problem is not always obvious, for example the error message in relation to the function unserialize(). If you look around the net to help you find countless search and few answers, because usually the problem lies in the source, in the passed value. But not always you can control it, especially in debugging helpers…

  • Activate WordPress Plugins Automatically via a Function

    Activate WordPress Plugins Automatically via a Function

    WordPress stores the active Plugins in the database table options, field activate_plugins, so it is easy to change this value to activate various Plugins by WordPress; either as a Plugin solution after setting up a new installation or because some Plugins need some other Plugins.