Skip to content

socialityCoop/wpboilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Boilerplate (Bedrock & UnderStrap)

To be honest it is not such a huge deal. We basically have combined the arctitecture of Bedrock provided by Roots with UnsterstrapChild. We have also added some plugins we use in all our websites.

Our goal is to provide our developers at Sociality with a ready to work WordPress installation in order to create custom websites using:

  • Composer for plugin managment
  • Git for versioning
  • npm for SASS processing

actully all features of Understrap, Understrap Child and Bedrock combined.

Οι οδηγίες είναι προσβάσιμες και στα Ελληνικά εδώ

Requirements

For developers on Windows we use:

Installation

  1. Download this repo as a zip
  2. Creat a new repo in your favorite git system and clone it in your local dev enviroment. If you use XAMPP is htdocs.
  3. Add the files you donwloaded in your new repo named newproject or as you with (you will need to change it in other places too as listed below)
  4. Open your cli and in the root director run composer install & composer update
  5. Create a copy of the env.example and name it .env.
  6. Create a Database and a Database user in your local environment and add the credentials in the .env file as following:
  • Database variables
    • DB_NAME - Database name
    • DB_USER - Database user
    • DB_PASSWORD - Database password (don't use the # character in the password - it will break)
  • You will also need to add WordPress Key. You can create yours here.
  • We have alreay provided the rest of the enviromental valiable for local developemnt (newproject.local). Ofcourse you can change them as you wish but you should take in mind that you should also change them in the gulpconfig.json file of the Child Theme. For deployment you will create a new .env file with the production enviromental variables.
  1. If you use XAMPP or Apache you should follow the following to access your website from your browser
  • Add the following to your hosts file (C:\Windows\System32\drivers\etc) 127.0.0.1 newproject.local
  • Add the following to your appache vhosts file (C:\xampp\apache\conf\extra\httpd-vhosts.conf):
    <VirtualHost *:80>
      DocumentRoot "C:\xampp\htdocs\newproject\web"
      ServerName newproject.local
      ServerAlias www.newproject.local
      ErrorLog "logs/ousite.gr-error.log"
      DirectoryIndex index.php index.html index.html
    </VirtualHost>
    
  1. Go to the Child theme directory web/app/themes/understap-child and run npm install
  2. Access in your browser http://newproject.local to finalize your WordPress instalation. You may need to restart appache.

You are ready! You can autorecomplie SASS with npm run watch To use BrowserSync you go to the Child Directory and run npm run watch-bs. You may need to first change the local browsersync output in /src/build/browser-sync.config.js. All changes you make in your SASS files will be automatically compiled and if you access the website through http://newproject.local:3000 the website will reload automatically everytime a change is made.

Documentation

Contributing

Contributions are more than welcome from everyone.