#author("2021-10-11T14:38:36+00:00","default:src128","src128")
&tag(WordPress/テーマ);
*目次 [#v6573841]
#contents
*関連ページ [#vb68db9c]
-[[../Simplicity]]
-[[../子テーマ]]

*参考情報 [#cfe3749f]
-[[「脱」初心者の為のブログのSEO:http://stinger3.com/seo/writting/]]
-[[WordPress › Support » Why is h1 not used in most themes?:http://wordpress.org/support/topic/why-is-h1-not-used-in-most-themes]]

**アイキャッチなしのテーマ [#s20c796d]
-Write / Write Pro
-[[WordPressでアイキャッチ画像を表示したくないならZEROがおすすめ! – FOXWP:https://fox-wp.com/zero-wordpress-theme/]]
*Tips [#i532bd80]
** 見出しに関して [#wd173238]
-記事の見出しはh2から始めるか、h3から始めるかという問題。
-テーマによって個別記事のタイトルがh1か、h2かさまざま。タイトルがh1なら見出しはh2から、h2ならh3から始めたほうがよさそう。だけど主流はh1をタイトルにして、見出しをh2から始める方式かもしれない。Twenty ElevenとかStinger3だとそうなっている。



**テーマをgitで管理する [#s0ae44fd]
-[[Vendor branches in git | Jabbering Giraffe:http://happygiraffe.net/blog/2008/02/07/vendor-branches-in-git/]]が参考になる。
#ref(wordpress_vendor_branch.png)

***手順1: 初回上流ソースをインポート [#la883dbc]
- supertheme.zipを展開しmasterにコミット。さらに今後のimport用にupstreamブランチを準備しておく。
#pre{{
  $ unzip supertheme.zip
  $ cd supertheme
  $ git init
  $ git add .
  $ git commit -m "Import supertheme 1.0"
  $ git tag v1.0
  $ git branch upstream
}}

***手順2: 上流ソースのアップデートに追随 [#he361caf]
-upstreamブランチに上流ソースをインポートしなおしてから、masterにmergeする。
#pre{{
  $ cd wordpress
  $ git checkout upstream
  $ rm -r *
  $ (cd .. && unzip supertheme-1.1.zip)
  $ git add .
  $ git commit -a -m 'Import supertheme 1.1'
  $ git tag v1.1
  $ git checkout master
  $ git merge upstream
}}


*Tips [#r1fffc41]

**テーマのバージョンアップ [#tdbea4f9]
-子テーマを作っている場合、親ネームをFTPなどでアップロードしてリネームするのが簡単。
-例えばSimplicity2の場合以下のようなフォルダをつくっておけば安全。
#pre{{
#!/bin/sh
set -eux

themesdir=/home/tanaka/public_html/wp/wp-content/themes
curname=simplicity2
newname=simplicity2.new
oldname=simplicity2.old

sudo rm -rf "$curname"
unzip $1
sudo chown nginx.nginx -R "$curname"

if [ -d "$themesdir/$oldname" ]; then
    echo "$themesdir/$oldname exists"
    sudo rm -rf "$themesdir/$oldname"
fi

sudo mv "$themesdir/$curname" "$themesdir/$oldname"
sudo mv "$curname" "$themesdir"
}}


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS