How to Use WordPress to Prototype Your App or Website
WordPress is one of the most popular Content Management Systems (CMS) around. Its popularity comes mostly from its ease of use and the range of functionality it offers.
No coding knowledge is required to use WordPress and it comes with a range of premium functionality that is packed with features. This allows even non-developers to have a go at creating and customizing a website.
With the launch of Gutenberg in 2014, WordPress offered even more functionality with built-in page builders and the like. These elements made it easier for anyone to create a fully functioning website with just a few clicks – even if you have never programmed in HTML or CSS.
In this article, we will discuss how to use WordPress to prototype your app or website so that you can see how it works together and make any necessary adjustments before launching your live version.
Set Up Your Development Environment
Before you start you will need to set up your development environment. You can either do this directly within WordPress or through a third party app/plugin like Github.
WordPress has a built-in web server that you can use to simulate a live website. This allows you to make changes to your prototype and see how they look live on your site before going live. You can also use this functionality to test out your web application directly from your phone.
Use Command Line To Make Changes
If you’re reading this, I assume you’re already aware of how powerful a command line is. I also assume that you’re familiar with the powerful Unix/Linux shell and its numerous command line tools. This is a perfect place to learn more about the command line and its numerous tools.
The command line allows you to make changes to your WordPress installation and prototype without having to worry about the layout and styling of your site. Every aspect of your site can be controlled through simple text commands that can be copied and pasted into your terminal window. The beauty of this is that if you make a mistake, you can simply undo it.
You can use any text editor that you’re familiar with to make these changes. I would recommend using something like Sublime Text or Vim for fast editing. These text editors offer additional features designed for working with code that you might find useful.
Once you’re comfortable making changes through the command line, you can start making more advanced edits to your site using a frontend text editor — something like Visual Studio Code for Windows or Mac users or Atom for Linux users.
Git-Wrangler For Version Control
Now that you have a working command line and text editor, you can start using version control tools to maintain your site’s original copy and make future edits. Two of the most popular ones are Git and Wrangler. Git is easy to learn and use and is extremely flexible. It works well with the command line and offers additional features like staged edits and interactive rebasing that make advanced editing a breeze.
Wrangler is a streamlined GUI (graphical user interface) for Git. This allows you to make all your changes through simple clickable menus that are easy to follow along with. It also makes comparing changesets easy since everything is laid out in a nice presentation format.
Both of these tools are available for FREE via the WordPress repository. Once you have installed and configured them on your system, you can start using them to make edits to your site.
Make A Backup Of Your Site’s Original Copy
You never know what could happen during the course of a project. Things could go horribly wrong – the site could be hacked, formatted or have spelling errors in all the important places. One of the worst things you could do is lose all your work because of a server crash or power outage.
To prevent this from happening, you need to make regular backups of your website’s original copy. You can either use a third party tool like BackupBuddy or a backup plugin for WordPress to make these regular backups for you – or you can set up a schedule to automatically make a backup every time you publish a post.
Backups are important for more than one reason. Not only do they allow you to recover from disaster if it happens, but they also allow you to make edits to your site without fear of losing all your work. Even if your site disappears off the internet for a couple of days, you can always go back to a previous version.
Use Git To Switch Back And Forth Easily Between The Latest And Older Versions Of Your Site
If you ever publish content that you later decide wasn’t quite right, you can use Git to easily switch back to the older version of your site. This is a great place to test out new ideas or see how a feature or layout looks in real life before making a decision. You don’t want to be limited to just one version of your site.
To do this, you need to have two sets of credentials. The first one will be your live login details for WordPress. The second one will be your admin username and password for Git. When you make your backup, you can either reuse the same password you use for your WordPress account (but beware of sharing your password with any third party) or you can create a new password specifically for Git and make sure you keep it secret.
As you can see above, Git will display a list of all your active branches. A branch is simply a version of your site’s code that you’re working on – and by default, WordPress will have several branches for you to work on (e.g. 2.7, 2.8, and so on).
To switch to a specific branch, you can type in the name of the branch you want to work on (e.g. “2.7” for version 2.7) or you can click on the branch to go directly to that version of your site.
To switch back to the previous version of your site, you can either click on the “HEAD” or the little dropdown arrow next to the branch name. This will take you back to the previous version (2.6 in this case)
To keep track of all the changes you’ve made and switch back to a previous version if needed, you can use Git’s built-in stashing functionality. Stashing allows you to temporarily hide changes you’ve made so that you can return to a previous version of your site if needed without overwriting your work. You can read more about stashing here.
Once you’re comfortable using the command line and Git, you can start using them to make edits to your site.
Use Vim Or Emacs For Editing
If you’re familiar with text editors like Notepad or Microsoft Word, you might decide to try out something more powerful and specialized for editing code. Two popular options are Vim and Emacs.
Vim is one of the most popular tools around for editing code. It was originally designed for the Unix platform a long time ago and was later ported to Microsoft Windows. To use it you will need to have a text editor already installed on your system.
The best thing about Vim is its extensive plugins that can extend its functionality further than you might expect. For example, if you’re a seasoned developer and want to see how a website would look with the same coding style as yours, you can use Vim’s ftplugin functionality to drop in your stylesheet and see how your layouts would match up.
Emacs is another powerful and extremely flexible text editor. It was originally created for the Emacs platform which many programmers use as an IDE (integrated development environment).
Emacs has several features that make it extremely valuable for developers, including matchit, which can find the pattern you’re looking for quickly and efficiently. You can also define your own keybindings for faster editing and navigation. For example, if you find the default arrow keys a little confusing, you can define your own sets of keys for easier navigation.
Both of these tools are, in my opinion, invaluable for any developer. Even if you’re not a developer, these tools offer a lot of value simply by making editing code much easier and more efficient. In addition to that, both of these tools have extremely large online communities supporting them with tips, tricks and documentation. If you get stuck somewhere, you can always search for the answer you’re looking for on sites like Stack Overflow.
Learn About WordPress Core
It’s no secret that WordPress is one of the most popular Content Management Systems (CMS) around. Its popularity comes mostly from its ease of use and the range of functionality it offers.