Skip to content

Wordpress Projects

Brendan Sheehan edited this page May 9, 2019 · 2 revisions

Manufactur: Manufactur Starter

Wordpress

Setup

cd wp-content/themes/manufactur-theme    # Enter project directory
npm install                              # Install dependencies 
gulp                                     # run gulp default task

wp-config.php

Your local environment settings will go here

Local URL

If you are pulling database from a remote server, you may need to update the site URL

define( 'WP_HOME', 'http://YOUR_LOCAL_ENVIRONMENT_URL' );
define( 'WP_SITEURL', 'http://YOUR_LOCAL_ENVIRONMENT_URL' );

LiveReload

Include the following to enable livereload

wp_register_script('livereload', 'http://localhost:35729/livereload.js?snipver=1');
wp_enqueue_script('livereload');

Synch Uploads

"Synch" uploads from a remote environment by configuring the following. This actually uses the assets from the remote server so we don't have to synch. This is not needed if we are using static file storage such as S3.

add_filter('pre_option_upload_url_path', function ($upload_url_path) {
    return 'http://REMOTE_ENVIRONMENT_URL/wp-content/uploads';
});

WP_DEBUG

Its good practice to enable WP_DEBUG. This will print out PHP errors or warnings.

define( 'WP_DEBUG', true );

Clone this wiki locally