Title: single.phpではなくarchive.phpが表示されてしまう。
Last modified: 2017年1月15日

---

# single.phpではなくarchive.phpが表示されてしまう。

 *  解決済 [ng](https://ja.wordpress.org/support/users/nogud/)
 * (@nogud)
 * [9年、 10ヶ月前](https://ja.wordpress.org/support/topic/single-php%e3%81%a7%e3%81%af%e3%81%aa%e3%81%8farchive-php%e3%81%8c%e8%a1%a8%e7%a4%ba%e3%81%95%e3%82%8c%e3%81%a6%e3%81%97%e3%81%be%e3%81%86%e3%80%82/)
 * いつもお世話になっております。
 * 個別ページにてsingle.phpが表示されずにarchive.phpが表示され困っております。
    
   こちらの解決方法、ご助言頂けると幸いです。
 * ■使用プラグイン
    ・CPT UI ・Custom Post Type Permalinks
 * ■デフォルトパーマリンク構造
    `http://xxx.com/%year%/%monthnum%%day%%hour%%minute%%
   second%.html`
 * ■カスタム投稿タイプのパーマリンク設定
    `http://xxx.com/file01/file02/%year%/%
   monthnum%%day%%hour%%minute%%second%.html`
 * ■カスタム投稿タイプ設定（CPT UI）
    public: true show_ui: true has_archive: true
   has_archive_string: exclude_from_search: false capability_type: post hierarchical:
   false rewrite: true rewrite_slug: file01/file02 rewrite_withfront: true query_var:
   true menu_position: show_in_menu: true show_in_menu_string: menu_icon: custom_supports:
 * ■現象
    `http://xxx.com/file01/file02/%year%/%monthnum%%day%%hour%%minute%%second%.
   html` 上記にアクセスした際にarchive.phpファイルの内容が表示されてしまう。 single.
   phpを表示させたい。
 * ヒントなどでも結構です。
 * よろしくお願いいたします。
    -  このトピックは[ng](https://ja.wordpress.org/support/users/nogud/)が9年、 
      10ヶ月前に変更しました。

3件の返信を表示中 - 1 - 3件目 (全3件中)

 *  [CG](https://ja.wordpress.org/support/users/du-bist-der-lenz/)
 * (@du-bist-der-lenz)
 * [9年、 10ヶ月前](https://ja.wordpress.org/support/topic/single-php%e3%81%a7%e3%81%af%e3%81%aa%e3%81%8farchive-php%e3%81%8c%e8%a1%a8%e7%a4%ba%e3%81%95%e3%82%8c%e3%81%a6%e3%81%97%e3%81%be%e3%81%86%e3%80%82/#post-212396)
 * 年月日時になっているからでしょう
 *  [Toro_Unit (Hiroshi Urabe)](https://ja.wordpress.org/support/users/toro_unit/)
 * (@toro_unit)
 * [9年、 10ヶ月前](https://ja.wordpress.org/support/topic/single-php%e3%81%a7%e3%81%af%e3%81%aa%e3%81%8farchive-php%e3%81%8c%e8%a1%a8%e7%a4%ba%e3%81%95%e3%82%8c%e3%81%a6%e3%81%97%e3%81%be%e3%81%86%e3%80%82/#post-212398)
 * パーマリンクのプラグインの作者です。
 * WordPressのURLの解釈の構造上、%post_id%もしくは%postname%をふくまないパーマリンク
   構造を設定すると投稿へのアクセスにならないケースがあります。
 * また、そういったURLでのテストは今のところ行っていないです。
 *  トピック投稿者 [ng](https://ja.wordpress.org/support/users/nogud/)
 * (@nogud)
 * [9年、 10ヶ月前](https://ja.wordpress.org/support/topic/single-php%e3%81%a7%e3%81%af%e3%81%aa%e3%81%8farchive-php%e3%81%8c%e8%a1%a8%e7%a4%ba%e3%81%95%e3%82%8c%e3%81%a6%e3%81%97%e3%81%be%e3%81%86%e3%80%82/#post-212411)
 * 皆様
 * ご返信ありがとうございます。
 * Hiroshi Urabe様からご指摘頂いた件を元に修正を行ってみたところ、post_idを含めさせる
   とsingle.phpが表示されるようになりました。
    また、私の投稿内容が間違っていたの
   ですが、すでに記載している、
 * `http://xxx.com/file01/file02/%year%/%monthnum%%day%%hour%%minute%%second%.html`
 * こちらでは、正常に表示がされ、下記ではsingle.phpが表示されませんでした。
 * `http://xxx.com/file01/file02/%year%/%taxonomycatest%-%monthnum%%day%.html`
 * おそらくデフォルトの投稿タイプと構造が違うため、正常にsingle.phpが表示されない？
   という認識でおります。
    また、上記構造においても、
 * `http://xxx.com/file01/file02/%year%/%taxonomycatest%-%monthnum%%day%-%post_id%.
   html`
 * 上記のようにpost_idをもたせるとsingle.phpが表示されました。
 * 今回はpost_id持たせる形で記述を進めようと思います。
 * ご助言ありがとうございました。

3件の返信を表示中 - 1 - 3件目 (全3件中)

 トピック「single.phpではなくarchive.phpが表示されてしまう。」には新たに返信する
ことはできません。

## タグ

 * [archive.php](https://ja.wordpress.org/support/topic-tag/archive-php/)
 * [パーマリンク](https://ja.wordpress.org/support/topic-tag/%e3%83%91%e3%83%bc%e3%83%9e%e3%83%aa%e3%83%b3%e3%82%af/)
 * [CPT UI](https://ja.wordpress.org/support/topic-tag/cpt-ui/)
 * [Custom Post Type Permalinks](https://ja.wordpress.org/support/topic-tag/custom-post-type-permalinks/)
 * [single.php](https://ja.wordpress.org/support/topic-tag/single-php/)

 * フォーラム: [プラグイン](https://ja.wordpress.org/support/forum/plugins/)
 * 3件の返信
 * 3人の参加者
 * 最後の返信者: [ng](https://ja.wordpress.org/support/users/nogud/)
 * 最後の活動: [9年、 10ヶ月前](https://ja.wordpress.org/support/topic/single-php%e3%81%a7%e3%81%af%e3%81%aa%e3%81%8farchive-php%e3%81%8c%e8%a1%a8%e7%a4%ba%e3%81%95%e3%82%8c%e3%81%a6%e3%81%97%e3%81%be%e3%81%86%e3%80%82/#post-212411)
 * 状態: 解決済

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
