静的ページでwordpressの新着情報が表示されません。
サーバはロリポップを使用しています。
PHP7.1でモジュール版を使用しています。
拡張子がhtmlでもphpが動作するように「.htaccess」も書き換えました。
別のロリポップサーバでは下記のソースコードと全くおなじコードで書いても問題なく
表示されるのですが、なぜか今使っているロリポップサーバでは表示されません。
phpを使用したお問い合わせフォームを作ったのですが、そちらは正常に作動し、問い合わせができます。
<?php phpinfo(); ?>
こちらのコードを書いてtest.phpとしてサーバにアップしましたが正常に表示されました。
何かよきアドバイスがあればお願い致します。
現状
「index.html」
<?php include_once("../news/wp-load.php"); ?> <!DOCTYPE HTML> <html> <head> </head> <body> <!-- wp_box --> <div class="wp_box"> <ul> <?php $posts = get_posts("numberposts=5&category=&orderby=post_date&offset=0"); foreach ($posts as $post): setup_postdata($post); ?> <li> <p><img src="img/wp/news_point.png" width="15" height="15"> <?php the_time('Y.m.d') ?> :<a href="<?php the_permalink() ?>"> <?php the_title() ?> </a> </p></li> <?php endforeach; ?> </ul> <p class="article_p"><a href="../news/">記事一覧</a></p> </div> <!-- wp_box --> </body> </html>
「.htaccess」
<FilesMatch ".html$"> AddHandler php7.1-script html </FilesMatch> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/12/08 08:03
退会済みユーザー
2017/12/08 08:10
退会済みユーザー
2017/12/08 08:11
退会済みユーザー
2017/12/08 08:12
退会済みユーザー
2017/12/08 08:18 編集
退会済みユーザー
2017/12/08 08:32
退会済みユーザー
2017/12/08 08:34
退会済みユーザー
2017/12/08 08:41