質問編集履歴
2
現在のコード
test
CHANGED
File without changes
|
test
CHANGED
@@ -31,6 +31,8 @@
|
|
31
31
|
宜しくお願い致します。
|
32
32
|
|
33
33
|
|
34
|
+
|
35
|
+
```php
|
34
36
|
|
35
37
|
<?
|
36
38
|
|
@@ -83,3 +85,5 @@
|
|
83
85
|
}
|
84
86
|
|
85
87
|
add_filter('term_link', 'my_custom_post_type_permalinks_set',11,3);
|
88
|
+
|
89
|
+
```
|
1
現在のコード
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,3 +7,79 @@
|
|
7
7
|
その方法があればご教授頂けますでしょうか。
|
8
8
|
|
9
9
|
何卒よろしくお願いいたします。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
12/9追記
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
下記のような形で現在記述しており、
|
20
|
+
|
21
|
+
「/〇〇_cat/〇〇〇〇/」 ⇀ 「/niniurl/〇〇〇〇/」
|
22
|
+
|
23
|
+
にできるとこまで確認できたのですが、
|
24
|
+
|
25
|
+
「/〇〇_cat/〇〇〇〇/」 ⇀ 「/〇〇〇〇/」
|
26
|
+
|
27
|
+
このようにする方法が分からずにいます。
|
28
|
+
|
29
|
+
ご教授頂けると助かります。
|
30
|
+
|
31
|
+
宜しくお願い致します。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
<?
|
36
|
+
|
37
|
+
register_post_type( '〇〇〇〇', array(
|
38
|
+
|
39
|
+
'labels' => array(
|
40
|
+
|
41
|
+
'name' => __( '〇〇' ),
|
42
|
+
|
43
|
+
),
|
44
|
+
|
45
|
+
'public' => true,
|
46
|
+
|
47
|
+
'has_archive' => true,
|
48
|
+
|
49
|
+
'menu_position' => 5,
|
50
|
+
|
51
|
+
'rewrite' => array( 'with_front' => false ),
|
52
|
+
|
53
|
+
'query_var' => false
|
54
|
+
|
55
|
+
) );
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
register_taxonomy( '〇〇〇〇_cat', '〇〇〇〇',
|
60
|
+
|
61
|
+
array(
|
62
|
+
|
63
|
+
'label' => '〇〇カテゴリー',
|
64
|
+
|
65
|
+
'hierarchical' => true,
|
66
|
+
|
67
|
+
'query_var' => true,
|
68
|
+
|
69
|
+
'rewrite' => array('slug' => 'info')
|
70
|
+
|
71
|
+
)
|
72
|
+
|
73
|
+
);
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
//カスタム投稿パーマリンク「/taxonomy/」削除
|
78
|
+
|
79
|
+
function my_custom_post_type_permalinks_set($termlink, $term, $taxonomy){
|
80
|
+
|
81
|
+
return str_replace('/'.$taxonomy.'/', '/', $termlink);
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
add_filter('term_link', 'my_custom_post_type_permalinks_set',11,3);
|