-
Install Docker Docker Installation Guide
-
Create a
docker-compose.yml
File In the root of your project (or a dedicated folder for your WordPress site) -
Create a Custom
php.ini
File In the root of your project directory, create acustom-php.ini
file to increase the upload size and adjust memory settings. -
Start the Docker Containers After setting up the Docker compose file and custom
php.ini
, start the Docker containers by running:docker-compose up -d
-
Access WordPress After the containers are up, you can access your WordPress site at: http://localhost:8000
-
Access phpMyAdmin phpMyAdmin will be available at: http://localhost:8080
You can use phpMyAdmin to manage your MySQL database. The login credentials are:
- Username:
root
- Password:
yourpassword
- Username:
Once WordPress is running locally, follow these steps to install the theme:
- Clone the Repository into the
wp-content/themes
Directory
In your WordPress Docker setup, thewp-content
directory is mapped to your local filesystem. Navigate to your WordPresswp-content/themes
directory and clone this repository:cd /path/to/your-wordpress-installation/wp-content/themes git clone https://github.com/DreamWay-Media/dwm-wp-theme.git
- Store Uploads and Plugins folders
After extracting the zip files, store the
Uploads
andPlugins
directories inwp-content
.
-
Place the Database File Place the MySQL database export file (
thisiswh_db_dev_dreamway.sql
) in the root of your project directory. -
Access the MySQL Container Once inside the MySQL container, log into MySQL using the root credentials:
mysql -u root -pyourpassword
-
Use the WordPress Database Tell MySQL to use the WordPress database:
USE wordpress;
-
Insert a new Admin User Run the following SQL command to insert a new user with admin privileges:
INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_status, display_name)
VALUES ('admin', MD5('yourpassword'), 'Admin', '[email protected]', 'http://localhost', NOW(), 0, 'Admin');
This command creates a new user named admin
with the password yourpassword
(replace this with your actual values).
-
Assign Administrator Role Next, assign the new user the administrator role by inserting the necessary records into the
wp_usermeta
table:INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES ((SELECT ID FROM wp_users WHERE user_login = 'admin'), 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES ((SELECT ID FROM wp_users WHERE user_login = 'admin'), 'wp_user_level', '10');
-
Exit MySQL
exit;
-
Log in to WordPress Admin Now, go to
http://localhost:8000/wp-admin
and log in with the usernameadmin
and the password you set in Step 4. You should now have full administrator access to the WordPress dashboard.
- Activate the Theme Once the theme is cloned, the database is imported, and have created admin credentials, log in to your WordPress admin dashboard at http://localhost:8000/wp-admin and go to Plugins to and activate each of them. Then go to Appearance > Themes to activate the theme.
To ensure consistency with styling, this project uses SCSS with npm and Sass for development. Follow these steps to set up and compile SCSS files.
-
Install Node.js and npm If you don’t already have Node.js and npm installed, download and install from Node.js.
-
Install Sass Dependencies In your themes root directory, run:
npm install
The following commands will allow you to compile SCSS files into CSS:
- Watch for SCSS Changes (during development) Run this command to automatically recompile SCSS to CSS as you make changes:
npm run sass
- Build for Production (compressed/minified CSS) When ready for deployment, use this command to generate a minified version of
style.css
:
npm run build-css
- SCSS Structure: All SCSS files are located in the scss directory, organized into subdirectories for base styles, components, pages, and templates.
- File Imports: The main scss/style.scss file imports all other SCSS files, which are then compiled into style.css.
After making SCSS updates, recompile CSS with:
npm run sass
Note: Avoid editing style.css
directly; all style changes should be made in SCSS files to ensure consistency.