サポート » テーマ » html/WordPress混在サイトのモバイル対応とテンプレート

  • いつもお世話になっております。

    仕事の案件で、既存の html サイトの一部に WordPress を組み込みました。
    Webサイトの本体に手をつけず、「インフォメーション」というコンテンツを追加するため、Wordpress をインスト-ルし、”information”というカスタム投稿タイプを追加し、Custom Post Type Permalinksプラグインにより、要件を満たしております。

    http://mysite/index.html などで従来サイトを表示
    http://mysite/wp/information でインフォメーション一覧を表示
    http://mysite/wp/information/35 で個別のインフォメーションを表示
    wpテンプレートは theme 内の archive-information.php と page-information.php です。

    ここで、サイトをモバイル対応にしたい旨の要望があり、.htaccessで以下のように設定しました。

    <IfModule mod_rewrite.c>
    RewriteEngine On
    # BEGIN MobileRedirect
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !mobile/
    RewriteCond %{HTTP_USER_AGENT} (iPod|iPhone|Android|Windows\ Phone)
    RewriteRule ^(.*)$ /mobile/$1 [R,L]
    # END MobileRedirect

    # BEGIN WordPress
    RewriteBase /wp/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    # END WordPress
    </IfModule>

    これにより、
    http://mysite/index.html などは http://mysite/mobile/index.html などに
    http://mysite/wp/information などは http://mysite/mobile/wp/information などに
    自動でリダイレクトされます。

    この際、
    http://mysite/mobile/wp/information では、テンプレートとして本来の archive-information.php ではなく、index.php が使用されてしまいます。
    wp 側のテンプレートはどのような仕様で用意すればよろしいでしょうか?

    希望としては、レスポンシブテンプレートではなく、モバイル専用のテンプレートとしたいです(モバイル側のhtmlコンテンツがjQuery Mobileを使用しているため)。

    どうぞお知恵をお貸しください。
    よろしくお願いいたします。

  • トピック「html/WordPress混在サイトのモバイル対応とテンプレート」には新たに返信することはできません。