Created
March 14, 2014 18:01
-
-
Save mattbanks/9553238 to your computer and use it in GitHub Desktop.
Scaffold a new WordPress development site in Alfred, utilizing WP-CLI. Use this script to run as a Terminal Script. Customize for your theme needs, plugin needs, etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create directory for new site | |
cd ~/Sites | |
mkdir {query} | |
cd {query} | |
# Download latest version of WordPress | |
wp core download | |
# Setup wp-config file with WP_DEBUG enabled | |
wp core config --dbname={query} --dbuser=root --dbpass=root --dbprefix={query}wp_ --extra-php <<PHP | |
define( 'WP_DEBUG', true ); | |
PHP | |
# Create database | |
wp db create | |
# Clone WordPress Starter Theme | |
cd wp-content/themes | |
git clone [email protected]:mattbanks/WordPress-Starter-Theme.git {query} > /dev/null 2>&1 | |
cd {query} | |
rm -rf .git | |
rm README.md | |
# Setup new git repo for theme | |
git init > /dev/null 2>&1 | |
git add . > /dev/null 2>&1 | |
git commit . -m "initial commit" > /dev/null 2>&1 | |
# CD back to site directory | |
cd ~/Sites/{query} | |
# Install WordPress | |
wp core install --url="http://{query}.dev" --title="{query}" --admin_user=mattbanks --admin_password=password --admin_email="[email protected]" | |
# Update Options | |
wp option update blogdescription '' | |
wp option update start_of_week 0 | |
wp option update timezone_string 'America/New_York' | |
wp option update permalink_structure '/%postname%' | |
# Get rid of default themes and Hello Dolly plugin | |
wp theme delete twentytwelve | |
wp theme delete twentythirteen | |
wp theme delete twentyfourteen | |
wp plugin delete hello | |
# Get plugins | |
wp plugin install wordpress-seo --activate | |
wp plugin install use-google-libraries --activate | |
wp plugin install pods --activate | |
wp plugin install google-analytics-for-wordpress --activate | |
# Activate theme | |
wp theme activate {query} | |
# Open ST3, Finder and Chrome | |
stt | |
oo | |
open http://{query}.dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment