回答編集履歴

1

コードの一部を変更しました。)?を)/?に。

2019/02/26 00:54

投稿

taaa
taaa

スコア32

test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ```PHP
8
8
 
9
- add_rewrite_rule('^animal/dog/([0-9]+)?$', 'index.php?p=$matches[2]', 'top');
9
+ add_rewrite_rule('^animal/dog/([0-9]+)/?$', 'index.php?p=$matches[2]', 'top');
10
10
 
11
11
  ```
12
12
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  ```PHP
16
16
 
17
- add_rewrite_rule('^animal/dog/([0-9]+)?$', 'index.php?p=$matches[1]', 'top');
17
+ add_rewrite_rule('^animal/dog/([0-9]+)/?$', 'index.php?p=$matches[1]', 'top');
18
18
 
19
19
  ```
20
20
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  ```PHP
26
26
 
27
- add_rewrite_rule('^animal/dog/([0-9]+)?$', 'index.php?post_type=dog&p=$matches[1]', 'top');
27
+ add_rewrite_rule('^animal/dog/([0-9]+)/?$', 'index.php?post_type=dog&p=$matches[1]', 'top');
28
28
 
29
29
  ```
30
30