Front End
6 minutes read
Wordpress is one of the most popular CMS and also the most used one today Typically, to create a wordpress based website, individuals begin by going to a wordpress hosting provider, which offer a service to instantly create a wordpress application for you. Later on, you could develop and edit your wordpress by going through the domain that you get from the hosting provider.
This method of developing the wordpress have a drawback where every changes we made to the website will instantly saved and reflected in deployment environment. It happens because wordpress doesn't have a built-in environment feature. Then, to changes environment, we basically will need to create another wordpress application. Which later on we need to do an export and import to sync between environment. This will becoming ineffective and creating a high cost when we're trying to collaborate with more peoples and need to have multiple development environment.
In order to overcome this issue, we might want to develop the wordpress application in our local machine, and then having a remote repository where we could integrate the works of many peoples on that same wordpress product. There's a few way to launch a wordpress locally, either we could use a software that manage a wordpress for us, or we could also create it using package manager. But, the options of using a software is much more simpler and easier. Since it will also install and create another dependecy that we needed to develop wordpress locally such as PHP because wordpress is written in this language, MySQL to serve as the database, and Nginx/Apache that serve to run its web server.
There's many options for software that provide service to develop wordpress locally, and one of the most popular is called Local. This is a very easy to use software, where we could create and run a wordpress application with a few clicks.
To start developing a wordpress using Local, first you could goes to its website and download the corresponding version with your computer. After that, you could follow its installation process.
Once the installation process is complete, you will be able to launch it. Later, to start creating your local wordpress application, you could follow this steps :
After completing the build process, local will directly show your project dashboard as shown bellow.
You either can click the 'WP Admin' button to start editing your wordpress or you could check the front end layer of your website by clicking 'Open site' button.
When going to the wordpress admin page, you will be first redirected to login page, you should use the credential that have been previously defined in wordpress configuration when creating this wordpress site.
After completing the initial setup for your wordpress locally, you might want to connect it with remote repository in order to give an access for that project to your team, also to allow your team to working together at developing it. In order to do that, first you should goes to your site dashboard in Local and click 'Open site shell'.
Local will open a terminal for your and your directory will already in 'public' folder. Then, you initialize git with 'git init' and set the remote repository accordingly. Later you can commit your changes in this folder and push it to the remote repository.
In order to clone a wordpress project from a remote repository and run it in your local machine. First you need to have the Local software, you could follow the instruction described previously. After that, you could follow the process described bellow, it won't as simple as cloning the projects from remote repository.
After successfully cloning the public folder, you should be able to run the same wordpress application that exist in the remote repository. Later on, you also could do a normal git operation to push and pull changes that been made to/from remote repository.
Another alternative to clone the projects, is by export and importing the wordpress from Local, then connect the 'public' folder to remote repository. For this method, you can start it by opening Local from the local machine of person who have this wordpress project and then follow this steps
After you have the .zip file of this wordpress project, then share that file to person that going to clone this project. Later, moving to the target local machine and follow this steps,
That's how you do development of wordpress based website from a local machine and initiate a collaboration with other people by connecting that wordpress project to a remote repository.