🍃このブログは移転しました。
3秒後、自動的に移動します・・・。

パーマリンク設定時の構成タグのメモ

WordPressパーマリンク設定のメモ。

パーマリンクの設定では、カテゴリー名やらタグ名やらを自動で使える機能があるにも関わらず、
なぜか日本語のCodexにはそれが書いてないような・・・?

参考:パーマリンクの使い方 - WordPress Codex 日本語版

なのでメモ!

参考;Using Permalinks « WordPress Codex

英語版にはあるのに・・。

構成タグ一覧

  • %year%:The year of the post, four digits, for example 2004
  • %monthnum%:Month of the year, for example 05
  • %day%:Day of the month, for example 28
  • %hour%:Hour of the day, for example 15
  • %minute%:Minute of the hour, for example 43
  • %second%:Second of the minute, for example 33
  • %post_id%:The unique ID # of the post, for example 423
  • %postname%:A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So “This Is A Great Post!” becomes this-is-a-great-post in the URI.
  • %category%:A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.
  • %tag%:A sanitized version of the tag name (tag slug field on New/Edit Tag panel).
  • %author%:A sanitized version of the author name.

使い方

パーマリンク設定のページに、カスタム構成という欄があるのでそこを選んで・・

カテゴリー名/投稿スラッグ名

/%category%/%postname%

などなど。

※複数カテゴリを設定してる場合は、自動で付与されるカテゴリIDが小さい数字のやつしか出ないらしい。