Maximizing WordPress

WordPress is not just a blogging platform. It it works great as a blog, but it can also be used to build any type of application you can think of. You can even use the latest Javascript frameworks such as AngularJS or BackboneJS thanks to the new WordPress JSON api. I have been building an application using WordPress to serve the data, and KnockoutJS to retrieve the data and build the user interface. I integrated compass and SASS into my theme so that I have an easily maintainable workflow for my css. With an open mind, you can do almost anything with WordPress. WordPress IS an application framework. It might not suit every project, but I urge urge you to at least keep an open mind.

Below are a few useful WordPress WordPress features that can take a WordPress site from a basic blog or brochureware site to an interactive application. This IS NOT a complete list.

Custom Post Types

When Custom Post Types were introduced to WordPress Core, it was a turning point, which took WordPress from a simple blogging platform into a real Content Management System. Custom Post Types make it easy for you to organize your content. For example, in addition to your posts and pages, you could create custom post types for news and events. Each custom post type can be customized. Don’t want a post thumbnail or text editor? You can remove them. You can add custom meta boxes for custom content. For example your events post type could have and event location meta box. If you really wanted to get crazy, you could create a custom post type called “tweets” the connects to your twitter account and every time you post a new tweet on twitter it will create that tweet on your WordPress site. If you haven’t used custom post types, then you may be missing out on a very useful feature.

WordPress REST Api

The direction of the internet seems to be things are moving more and more to the client. The MEAN stack is getting all the attention on the internet these days. While WordPress as we know it will most likely never run on the MEAN stack, we can still take advantage of any of the latest front end javascript frameworks such as AngularJS, BackBoneJS, orReact among many others thanks to the new WordPress REST Api. The REST API is new to WordPress. As of the time of this writing, the REST API can be obtained in the form of a plugin. However, the plugin is being slowly beingadapted into WordPress core. As of WordPress version 4.4, the first half is officially added to WordPress core.

The API allows you to do things you’d expect to be able to do with a REST api such as access, create, update, and delete posts. You can also create your own custom endpoints allowing for endless possibilities.

BuddyPress

BuddyPress is a neat open source plugin that allows your to turn WordPress into a social networking site. With BuddyPress you can do anything you’d expect to be able to do in a social networking site: create a user profile, add pictures, make friend connections set up message boards, organize public and private groups, and much more. The plugin is also very customizable. There are lots of actions and filters that allow you to change the behavior of BuddyPress. The plugin works well for small social networking sites for Universities or special interest groups.

Custom Meta Boxes

I love custom meta boxes. With custom meta boxes, you can create custom fields inside of your posts. The possibilities are endless. I mentioned earlier, if you had an events custom post type, you could add a meta box for event location, event start date or event time. You can create any type of field such as a text box, radio button, check boxes etc. Fields can also be repeatable. Say you wanted to add a todo list meta box to your post. You could have a field for a text area and have a “+” and “-” so that users could add or remove todos. The sky is the limit. I have even linked post meta to external api’s in order to grab videos from external services in the form of radio button options.

Custom Taxonomies

WordPress taxonomies are another way that helped to change WordPress from a blogging platform to a CMS. Taxonomies are a way that you can classify your posts into one or more categories. The built in taxonomy for WordPress posts is “categories”. However, you can make new taxonomies and apply them to custom post types if needed. For example, if you had a post type named “products” you could add a taxonomy called “product type”. Each new category for the taxonomy we add are called “terms”. So for type we could add the terms: “electronics”, “toys”, and “furniture”. Then, if we wanted to query our products by a certain category we can easily do that by creating a new WP Query with a tax query.

Options and Settings Api

The options and settings APIs allow you to create global application settings. When you are first setting up WordPress one of the first things you will do is go into your settings under your admin and set the title of your site, your email, permalink structure among other things. Using the options and settings api, you can add your own custom settings. For example if you wanted to integrate twitter into your site, you might want to create a custom settings page to add your user’s twitter user name and api key and any other settings that might be required to integrate it. This is extremely useful for plugins, where settings will change from site to site.

Shortcodes Api

Shortcodes are snippets of code that make it easy for an end user to add custom functionality into your WordPress site. One of the common uses for shortcodes I often see in theme frameworks is to create shortcodes that allow users to create columns in their posts. For example you can create a shortcode that allows the user to separate the post content into two or more columns. This would easily allow somebody who isn’t experienced with css and html to give more options for their post content styling. Shortcodes allow you as a developer to easily create code that is reusable by the end user.

There are many more ways that WordPress can be customized to create actual web applications. I have only mentioned a few ways that come to mind that have been very useful for me personally. Since I use WordPress on an almost daily basis, I am regularly finding new ways that push the limits and surprise me where I say “Hey, I didn’t know I could do that with WordPress!”