LoginSignup
32
31

More than 5 years have passed since last update.

Wocker でテーマ作る時によく使うコマンド

Last updated at Posted at 2015-08-03

基本的な使い方はこちらから

■Wocker Commands | Wocker
http://wckr.github.io/commands/

■wocker 使ってみた感レポ
http://qiita.com/mikakane/items/1bbabe4d27bebf28fd00


2016.01.12 追記

@Next_Season さんがイケてる方法書いてくれてます。

■wockerで初期設定をサクッと終わらせる
http://note.next-season.net/cms/wordpress/808


コマンド一覧

SSHでログイン

$ vagrant ssh

新規のコンテナ作成

既存のコンテナが起動していないか確認

core@wocker ~ $ wocker ps -a

コンテナが動いていなければ新規でコンテナ作成

core@wocker ~ $ wocker run --name CONTAINER_NAME

WP-CLI でコアのアップデート

core@wocker ~ $ wocker wp core update

// 日本語環境
core@wocker ~ $ wocker wp core update --locale=ja

日本語で WordPress を使用する

core@wocker ~ $ wocker wp core language install ja --activate

日本語にしたら必ず「WP Multibyte Patch」をインストールして有効化

core@wocker ~ $ wocker wp plugin install wp-multibyte-patch --activate

WP-CLI でプラグインをインストールして有効化

テーマ開発に役立つ以下のプラグインを一気にインストールして有効化する。

core@wocker ~ $ wocker wp plugin install theme-check debug-bar debug-bar-extender --activate

テーマユニットテストデータの日本語版をいれる

■jawordpressorg/theme-test-data-ja
https://github.com/jawordpressorg/theme-test-data-ja

core@wocker ~ $ wocker theme-test ja

もう少し簡単な確認をしたい

こちらを使用します。

■コンテンツエリアのマークアップで必要なHTMLの要素。コピペすると使える。 | Shinichi Nishikawa's
http://nskw-style.com/content-area-markup

コピペするの大変なので txt ファイルにして、 Gist だと更新したら URL 変わるので GitHub に勝手にあげてあるので curl で保存します。

cid=$(docker ps -q) && docker exec -u wocker $cid curl -OL 'https://raw.githubusercontent.com/shimakyohsuke/wocker_wp_post_create/master/content-area-markup.txt'

cid=$(docker ps -q) で、今動いているコンテナの確認。
docker exec -u wocker $cid curl -OL 'https://raw.githubusercontent.com/shimakyohsuke/wocker_wp_post_create/master/content-area-markup.txt' で、Nishikawa さんのデータを動いているコンテナに保存しています。

テキストファイルはこちらに置いてます。
https://github.com/shimakyohsuke/wp_post_create

コンテナに保存したテキストファイルを WP-CLI を使って投稿を作成

■wp post create | WP-CLI
http://wp-cli.org/commands/post/create/

wocker wp post create content-area-markup.txt --post_title='Nishikawa さんが作成したテーマユニットテストデータ' --post_status=publish

さくっと確認するのはこちらのほうがいいかもしれませんね。

32
31
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
32
31