Giter VIP home page Giter VIP logo

site-wordpress's Introduction

@Herm71's WordPress WP-ENV Dev Environment

This workflow assumes you have Docker running and npm installed.

If wp-env is not installed globally, the command npm install will install it locally and provide a wp-env script for running wp-env.

This setup maps wp-content/themes to a separate working directory outside this environment. This enables working on themes outside this root directory, which is my preferred development workflow.

Recommendations

Features

  • .wp-env.json that maps theme development directory outside this root environment
  • .htaccess file for adjusting site (eg., "pretty permalinks")
  • WordPress Importer plugin for importing default content (such as Theme Unit Test).
  • Theme Check plugin for testing theme against the latest WordPress theme standards and practices

Install

  • clone this repo to a directory (eg., wp-env-site-root/) and cd into it
  • run command: npm install or npm i
  • edit .wp-env.json to add your dev theme directory as described below
  • run command: npm run wp-env start (or simply wp-env start if you already have wp-env installed globally)
  • visit your new site at http://localhost:8888/
  • login to the Dashboard
    • default username: admin
    • default password: password
  • activate development theme via Dashboard->Appearance->Themes

Your working environment directory setup should look like this after build:

wp-env-site-root/
  |---.wp-env.json
  |---.htaccess
  |---mu-plugins/
  |---plugins/
    |---theme-check/
    |---wordpress-importer/
  |---mu-plugins/
  |---themes/ # any themes pulled in via git in .wp-env.json. Not dev theme.
dev-theme-dir/
  |--[dev theme directory location set up in .wp-env.json]

Edit wp-env.json

Edit the "mappings":"wp-content/themes": value in .wp-env.json to point to your theme development directory. Your theme will be loaded but not activated in the site's dashboard.

If you were working on a plugin you could add an additional key for "wp-content/plugins": to the "mappings": array to point to a development plugin directory.

site-wordpress's People

Contributors

herm71 avatar

Stargazers

Yuri Baranov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.