質問編集履歴
1
内容の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -4,4 +4,72 @@
|
|
4
4
|
|
5
5
|
この記事ならうまくいくサイトを知っている方はいないでしょうか?
|
6
6
|
|
7
|
-
サーバーはエックスサーバーです。
|
7
|
+
サーバーはエックスサーバーです。
|
8
|
+
|
9
|
+
ファイルですが.htaccessは↓です。
|
10
|
+
|
11
|
+
```.htaccess
|
12
|
+
SetEnvIf Request_URI ".*" Ngx_Cache_NoCacheMode=off
|
13
|
+
SetEnvIf Request_URI ".*" Ngx_Cache_StaticMode
|
14
|
+
|
15
|
+
|
16
|
+
# BEGIN WordPress
|
17
|
+
# "BEGIN WordPress" から "END WordPress" までのディレクティブ (行) は
|
18
|
+
# 動的に生成され、WordPress フィルターによってのみ修正が可能です。
|
19
|
+
# これらのマーカー間にあるディレクティブへのいかなる変更も上書きされてしまいます。
|
20
|
+
<IfModule mod_rewrite.c>
|
21
|
+
RewriteEngine On
|
22
|
+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
23
|
+
RewriteBase /
|
24
|
+
RewriteRule ^index.php$ - [L]
|
25
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
26
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
27
|
+
RewriteRule . /demo/index.php [L]
|
28
|
+
</IfModule>
|
29
|
+
|
30
|
+
# END WordPress
|
31
|
+
|
32
|
+
|
33
|
+
AddType x-httpd-php .html .htm
|
34
|
+
```
|
35
|
+
|
36
|
+
index.htmlは↓です。
|
37
|
+
```index.html
|
38
|
+
<?php require './demo/wp-blog-header.php'; ?>
|
39
|
+
|
40
|
+
<!doctype html>
|
41
|
+
<html lang="ja">
|
42
|
+
<head>
|
43
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
44
|
+
<meta charset="utf-8">
|
45
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
46
|
+
<link rel="stylesheet" href="css/reset.css">
|
47
|
+
<link href="css/style.css" rel="stylesheet" type="text/css">
|
48
|
+
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
|
49
|
+
<link href="https://fonts.googleapis.com/earlyaccess/hannari.css" rel="stylesheet" />
|
50
|
+
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+JP&display=swap" rel="stylesheet">
|
51
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
52
|
+
|
53
|
+
<title>ルナゾーム</title>
|
54
|
+
</head>
|
55
|
+
<body>
|
56
|
+
|
57
|
+
<h2>新着情報</h2>
|
58
|
+
<ul>
|
59
|
+
<?php
|
60
|
+
$posts = get_posts("numberposts=5&category=&orderby=post_date&offset=0");
|
61
|
+
foreach ($posts as $post):
|
62
|
+
setup_postdata($post);
|
63
|
+
?>
|
64
|
+
<li>
|
65
|
+
<?php the_time('Y.m.d') ?>
|
66
|
+
<a href="<?php the_permalink() ?>"><?php the_title() ?><?php the_post_thumbnail('thumbnail'); ?></a>
|
67
|
+
<?php echo mb_substr(get_the_excerpt(), 0, 30); echo '...' ; ?>
|
68
|
+
</li>
|
69
|
+
<?php endforeach; ?>
|
70
|
+
</ul>
|
71
|
+
|
72
|
+
</body>
|
73
|
+
</html>
|
74
|
+
|
75
|
+
```
|