Last modified on 01 Oct 2021.
I create Math2ITwp theme for math2it.com from scratch. This note contains the basic things to create a theme like that.
Install Apache + MySQL + PHP.
Linux
Below are the short steps from this post.
Windows
- Download and install WampServer.
- By default, after installing, your site will be at
C:\wamp64\www
. - Run WarmServer, an green icon on the right of taskbar will appear.
MacOS
PHP executable (optional)
Just for running PHP + PHP IntelliSense
on Visual Studio Code.
- Download PHP (Windows, portable).
-
Put below lines in VSC setting file (change the path to yours).
{ "php.validate.executablePath": "C:\\wamp64\\bin\\php\\php7.0.4\\php.exe", "php.executablePath": "C:\\wamp64\\bin\\php\\php7.0.4\\php.exe" }
Create local database + Wordpress
Create a database
- Open
http://localhost/phpmyadmin/
, - Create a new database
testing_db
(remember to chooseutf8_general_ci
before pressing Create) - Create a new user
thi
withALL PRIVILEGES
(click on Check all).
Install Wordpress
- Download Wordpress.
- Create a folder
thi
inC:\wamp64\www
(Windows),/var/www/html
(Linux). - Extract the content (
wp-admin
,wp-content
,…) of the zip file downloaded in step 1 to/thi/
. - Go to
http://localhost/thi
and follow the instructions. - Type the username and password you created (
thi
andthipassword
). - Press Install and wait.
- Login with username and password.
- All the configuration is at
http://localhost/texmath/wp-admin/
.
Clone a website to localhost
- Install Apache + MySQL + PHP.
- Create database + install Wordpress.
- At least, you have a workable site at
http://localhost/thi/
. - Download and install an FTP app like WinSCP (Windows) or FileZilla or Transmit.
- Download the current theme on the remote to local. The theme is located at
/wp-content/themes/
. - Clone database from remote site to local by using plugin All-in-One WP Migration. More detailed guid: English, Vietnamese. If your site’s too big, exlude the media files and copy them later. They’re all in
wp-content/uploads
. - Note that, you have to use
username
andpassword
given in the downloaded database instead of the one you created on localhost. - Enable the downloaded theme in
/wp-admin
.