TopNav

Hacking WordPress the right way

Too many times we’ve worked on WordPress sites where the designer is simply too ignorant about the power of WordPress to do the job right. You know you’ve stumbled upon one of those sites when you get to the WordPress post/page content editor and find an HTML template for updating pages or posts that you must abide by otherwise your content becomes scrambled. What’s the right way to do it? Either with a plugin or a custom post type; here’s how it works!

Let’s start with testimonials as an example. Let’s say you’ve got a page of testimonials. You login to the WordPress admin only to find that it’s one long page filled with flat text quotations and author info wrapped in div and/or blockquote tags. Messy stuff! How do you fix this? There’s two options: use a plugin or create your own custom post type.

Use a Plugin

Continuing with our testimonials example, there’s a fantastic FREE testimonial management plugin that we’ve used before called GC Testimonials. It solves the issue by setting up a “Testimonials” post type in the WordPress admin menu — simply hover over it, choose Add New and enter in the testimonial information. You can then show your testimonials in the front-end sidebar or on a page via shortcode or both. Awesome! And no more custom code required.

But what happens if nobody has created a plugin to manage the type of content you want? This is where the hacking comes in: custom post types to the rescue!

Custom Post Types

The GC Testimonials plugin (among others) creates a custom post type called Testimonials which allows you to easily add a new testimonial in the same format as you would a blog post. But if you can’t find a plugin to do this for you, you can also create the testimonial type yourself! I’m not going to go into a ton of detail as to how this works, as the WordPress Codex describes it in plenty of detail and there are dozens of blog posts easily found on Google all about creating custom post types. There’s even a handy wizard custom post type code generator you can use — answer the questions, then copy / paste the code output and you’re all set!

Do it the right way!

Custom post types are the right way to create WordPress websites with custom content styles. Don’t push your users to understanding code by forcing HTML code templates on them! Build these website sections the right way: use custom post types.

, ,

No comments yet.

Leave a Reply