Code Generators to Speed Up Your WordPress Development

March 22, 2017

As WordPress developers, we’re always looking for ways to speed up our work flow and shorten development time. So we were super excited when someone told us that the developers at Nimbus Themes had created a set of WordPress Code Generators. This set of tools is not only a great way for experienced developers to save time, but they are extremely useful for those who are new to WordPress coding.

There are currently twenty code generators available, and they are broken down into seven different categories:

  • Loop
  • UI & Design
  • WP Core
  • Admin
  • Content
  • CSS
  • Snippets

How to Use Them

The user interface for each generator is intuitive and straight forward. Form fields are divided into tabs that help you fill in the necessary options. The code is generated on-the-fly for you. From there, you can copy and paste it into your functions.php or style.css file depending on which generator you are using.

To give you a better idea of how to use them, let’s take a look at the WP_Query tool. Let’s say we need a page on our site to display our themes, which are a custom post type. And of course we’ll want the themes to be listed in order from newest to oldest. This would require a custom query, and this is where the WP_Query code generator comes in very handy.

Step 1: General Settings

First, we will define our theme slug and unique query variable identifier under the general tab. The theme slug is used to prefix your function and it’s usually the same string as the text domain. The query variable identifier should be something descriptive about the query and unique.

Step 2: Define the Post Type

Since our themes are a custom post type, we will need to specify this under the Post/Page tab. Otherwise, the query would retrieve all posts.

Step 3: Set the Display Order

Under the Misc. tab we will set Display Order and Date so that the query retrieves the themes and puts them in order from newest to oldest.

Step 4: Copy and Paste the Code

Once we have completed choosing our options, we can scroll to the bottom of the tool, and copy and paste our code. Click the Copy to Clipboard button.

So how do we get this code into our theme? In this instance, we would most likely use a page template. So once the page template is created, we would simply paste the WP_Query code in. After the “// Do layout” comment is where we would add some html to display the content from the query.

Conclusion

As mentioned before, these Code Generators are super useful for both experienced WordPress developers and for those who are just learning the ropes. So if you are looking for new ways to make your workflow more efficient, you should certainly give these a try.