現在位置: Top/WordPressの改造
- 履歴一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- WordPressの改造 へ行く。
WordPressの改造
個別記事のリンクをMovableTypeと同じにする
- wp-includes/template-functions-links.phpを編集する
29行目$rewritereplace = array( date('Y', $unixtime), date('m', $unixtime), date('d', $unixtime), date('H', $unixtime), date('i', $unixtime), date('s', $unixtime), $post->post_name, $post->ID, $category, $author, $post->post_name, );
のなかの$post->ID,
をsprintf("%06d",$post->ID),
とする。 - パーマリンクの設定
「オプション」→「パーマリンク設定」
「独自表記を以下の入力欄に記述」を選択し、
「カスタム構造」に/archives/%post_id%.html
と入力する。
- ゼロでパディングされた記事番号のリンクが生成されますが、ゼロのまま値を渡しても記事番号として認識します。