wp core download
in your terminalWebsites
, and within it, I have subfolders for each yearexample.com
, your folder will be named example.dev
wp-content/plugins/hello.php
wp-content/plugins/hello.php
wp-content/themes/twentyfifteen
wp-content/themes/twentysixteen
.wp-gitignore
file .wp-gitignore
.gitignore
file is modelled after WPEngine’s recommendations./wp-admin/
, and wp-includes
, etc)node_modules
, and .sql
files.wp-gitignore
file to .gitignore
.gitignore
at the root of the example.dev
folderexample.dev/wp-content/themes/
in your terminal and type git clone https://github.com/melissajclark/_s.git
example.dev/wp-content/themes/
wp-content/themes/_s/
folder, delete the .git
folderwp-content/themes/_s/
folder, delete the .gitignore
file .git
and .gitignore
files, you may need to enable seeing invisible files.wp-content/themes/_s/readme.md
filewp-content/themes/_s/readme.txt
filewp-content/themes/_s/assets/images/logo.svg
filewp-content/themes/_s/assets/images/
and name it logo.svg
wp-content/themes/_s/assets/sass/login-style.scss
file for more detailsCommand
+ Shift
+ F
in Sublime Text to bring up the Search in Folder panel
-*.txt,-*.md
in the Where: field to exclude markdown and .text filesCommand
+ S
to quickly save and bypass the Save / Exit messages that come upCommand
+ W
to quickly close files you do not want to change_s
folder to example
example
folder in your text editor (I use Sublime Text)'_s'
and include the single quotations to capture the theme’s text domain.
'example'
._s_
to capture all the function names.
example_
.Text Domain: _s
in style.css
'Text Domain: example
.example
. _s
(with a space before it) to capture DocBlocks.
example
._s-
to capture prefixed handles.
example-
.Theme URI: http://underscores.me/
to capture the theme’s URL
Theme URI: http://example.com
(the client or project’s URL)Description: Naked WordPress starter theme, via Automattic.
to capture the theme description
Description: Custom WordPress theme developed for Example by Melissa Jean Clark
Renaming functions in the WordPress theme
For this step you can use MAMP / Vagrant / Local / etc, the tool does not matter. You just need a local environment that can run WordPress.
The gulpfile.js
and package.json
follow Ahmed Awais’ WPGulp set up. See his notes for more info on setting up: WP Gulp.
wp-content/themes/example/gulpfile.js
file:
wp.dev
example.dev
(or whatever your local site URL will be)npm install
or sudo npm install
to install the Gulp dependencies for our themegulp
to test it outAt this stage, your WordPress development environment is set up. All code will be stored in a private Bitbucket repository.
The steps above may seem like a lot, but a lot of them are tiny things like renaming a folder, or deleting a file. The initial setup listed above takes me about fifteen minutes.
BAD: <h1>Events</h1> ```
_e
part of the function ensures the content is available for translation.'example'
part of the function is the text domain (theme name)id
return option.get_field('field_name')
every time reduces calls to the database and keeps code organized