Giter Site home page Giter Site logo

freelance-200acres's Introduction

WordPress, Composed

Load WordPress core and plugins via Composer.

Setup

  1. Setup your server so that public is the web root.

  2. Run composer update to install WordPress.

  3. Copy vendor/wordpress/wordpress/wp-config-sample.php to config/wp-config.php. In this file, do a couple things:

    1. Update database settings
    2. Define the following two constants, which will tell WordPress where to find plugins, themes, and uploads:
    define('WP_CONTENT_DIR', dirname(__DIR__) . '/public/assets');
    define('WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/assets');
  4. Go to yoursite/wp-admin/ and run through the WordPress install.

  5. Install some plugins using WordPress Packagist. Advanced Custom Fields, for example:

"require": {
	"php": ">=5.2.4",
	"wordpress/wordpress": "3.6"
    "wpackagist/advanced-custom-fields": "4.2.*"
}

How it works

WordPress is loaded as a package by referencing its source on GitHub, while WordPress Packagist is loaded as a repository, which allows us to require plugins from it like we require packages from Packagist.

When either the update or install Composer commands are run, the wp-config-symlink script is triggered, which creates a symlink from vendor/wordpress/wp-config.php, where WordPress expects to find a config file, to config/wp-config.php, where we manage our config file.

In addition to the symlink created by our Composer-hooked script, a few more symlinks exist in locations that WordPress expects to find its files. If you take a look in public, you'll see three symlinks:

wp-admin -> ../vendor/wordpress/wordpress/wp-admin
wp-includes -> ../vendor/wordpress/wordpress/wp-includes
wp-login.php -> ../vendor/wordpress/wordpress/wp-login.php

This allows the WordPress admin to function from its home in vendor.

freelance-200acres's People

Contributors

jenwachter avatar jasonrhodes avatar

Watchers

James Cloos 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.