Code Monkey home page Code Monkey logo

wordpress-composer's Introduction

Composer Template for WordPress Projects

This project template should provide a kickstart for managing your site dependencies with Composer.

This project consist of:

  • WordPress core: johnpbloch/wordpress-core-installer
  • Repository https://wpackagist.org/ to install WordPress plugins and themes
  • composer/installers to set custom paths for plugins and themes
  • drupal-composer/preserve-paths to exclude paths for plugins and themes under version control
  • wodby.yml that runs composer install. You can remove it if you're not using Wodby

Paths

By default, wordpress core will be installed in ./web directory. Plugins and themes are installed in ./web/wp-content/plugins and ./web/wp-content/themes.

Usage

  1. First you need to install composer
  2. Fork and clone this repository
  3. Run composer install in your repository root

How to install WordPress plugins and themes?

Update require section in composer.json as described on https://wpackagist.org/

How to manage my custom themes and plugins under version control?

  1. Exclude path to your plugin or theme from .gitignore. Example for theme under web/wp-content/themes/my-custom-theme/:
    !web/
    web/*
    !web/wp-content/
    web/wp-content/*
    !web/wp-content/themes/
    web/wp-content/themes/*
    !web/wp-content/themes/my-custom-theme/
    
  2. Add the same path to your composer.json under extra > preserve-paths:
    "preserve-paths": [
      "web/wp-content/themes/custom"
    ]
    
  3. Add your plugin/theme directory under version control
  4. Run composer install. Composer will install WordPress core and keep your custom theme

Deployment via Wodby

  1. Fork this repository
  2. Connect the repository to Wodby
  3. Deploy new app, choose WordPress stack, on the 2nd step of the form choose connected repository and enter web as Codebase dir

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.