Category: WordPress

  • Speed Up Your Genesis Theme by Reducing Database Queries

    WordPress ships with a bunch of nifty methods to improve performance and knowing when to use one of them could cut the number of database queries on your site by over 60%.

    Post Thumbnail Caching

    It has to do with the way post thumbnails are displayed in a loop.

    By default, whenever get_the_post_thumbnail() is called in the main loop for the first time, WordPress looks up data for all thumbnails that are likely to appear and caches them. Otherwise, the thumbnail data for each post needs to be fetched on each iteration of the loop at a cost of two additional queries per thumbnail: One for the attachment and one for the attachment’s meta data.

    So what exactly is the method? It’s a simple function, aptly named update_post_thumbnail_cache(). (more…)

  • Introducing AudioTheme

    AudioTheme Homepage

    A few years ago, we published a popular country music blog* and part of our duties required visiting band websites every day — back when MySpace was big and the primary online presence for many bands (we have the benefit of hindsight to see how that went). Helping artists with their websites was an idea we put a lot of thought toward at the time and eventually dismissed as too much work. One problem is their needs often far outweigh their budgets.

    Not much has really changed over the intervening years. Artists still have to sign up for dozens of different services to stay connected with their fans and their sites are woefully sub par. We’re hoping to change that.

    About a year ago, Luke McDonald and I started working on a simple little plugin to easily add post formats to the admin menu in WordPress. From that project, he introduced us to a couple of other designers (Erik Ford and Sawyer Hollenshead) he was working with on a project called AudioTheme. I didn’t realize it at the time, but I had read about AudioTheme on WP Candy back around the time we formulated our own ideas for a platform and figured we had been beaten to the punch. So when Luke asked us to join, it was a fairly easy decision.

    All that’s to say, we’re excited to finally unveil AudioTheme — a platform built on WordPress to bring the features artists and bands need to manage their online presence to them, instead of having to go to the features across dozens of fragmented services. Fans should be able to go to a band’s website and find high quality artwork, lyrics to the songs they’ve written, and listen to their music. And it should be easy for artists to manage their content — on their own websites.

    There certainly isn’t a reason bands shouldn’t own their data in this day and age.

    With AudioTheme, we’ve built a framework to allow for all of that and more. In addition, we’re launching a marketplace of themes that are geared specifically towards musicians, all built on the same platform, making the data portable. Switching a theme no longer means existing plugins need to be re-integrated; it’s as easy as switching the theme for a basic blog.

    Simple to use, own your data, low cost, and attractive — in a way, AudioTheme aims to be WordPress for music makers.

    By extending WordPress, we hope to enable thousands of designers and developers to leverage their existing skills without having to learn a totally new platform and plan to refine the tools and processes over time to make it ever easier to build complex music-oriented websites. If you’re interested in joining our marketplace, get in touch. We’d love to hear from you.

    Visit AudioTheme.com Now

    *We have to give a shout out to Juli Thanki for taking up the mantle and providing a truly excellent resource for roots music fans at Engine 145.

  • A WordPress Class Template Tag to Rule Them All

    Last week, on Twitter…

    Yes, I know, that’s the beginning of a terrible blog post. But really, a tweet by Jonathan Christopher piqued my curiosity last week:

    https://twitter.com/jchristopher/status/273437718653050880

    SMACSS? I hadn’t heard of it and figured it was probably some Mac-only app, but looked it up anyway. Lo and behold, it was actually interesting. I haven’t really changed the fundamentals of the way I write CSS for a couple of years, don’t use a pre-made grid, and have yet to adopt a pre-processor.

    (more…)

  • Abstracting Custom Post Type and Taxonomy Registration In WordPress

    Custom Post Types in WordPress are incredibly useful, but as a web developer working on a number of projects at any given time, it can be frustrating having to manually write out each and every label needed for display throughout the dashboard.

    While reviewing plugins and other projects, I’ve seen developers build libraries to abstract away a lot of the mundane details of creating CPTs by dynamically generating default arguments and labels. Unfortunately, there are a few pitfalls with this approach that don’t make it a viable option:
    (more…)

  • Custom Post Types Are Not Posts

    Custom post types are not posts.

    However, posts are a specific implementation of a CPT. As are pages. And nav menu items. And revisions. Oh, and attachments, too. Hell, at some point, comments could probably even be integrated as CPTs. Are all of these objects the same just because they’re CPTs? See where I’m going with this?

    CPTs are not posts.

    For most intents and purposes, forget that “Post” is even part of the name.

    There has been a little discussion around the usage of CPTs and shortcodes in WordPress themes meant for public release over the past week or two. It’s actually been an ongoing discussion for awhile, but it recently heated up a bit and sparked a few reactions.

    (more…)

  • Treasure Hunting In WordPress Core

    As WordPress organically evolves based on the needs of the community — from blogging engine, to content management system, and toward an app platform — it’s become ever more important that its default behavior can be modified to suit a wide range of demands. The primary means of making customizations is through the use of hooks, which consist of actions for executing functionality at a specific point in time, and filters for modifying data passed through them. Plugins and themes take advantage of this system to extend WordPress in an unlimited number of ways.

    One of my very first plugins simply limited the length of post titles so they didn’t break the design if they were too long. We’ve all come a long way since then!

    (more…)