回答編集履歴
3
追記
answer
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
// add_theme_support('automatic-feed-links');
|
35
35
|
add_action( 'wp_head', 'feed_links', 2 );
|
36
36
|
function lf_custom_feeds_alternate() {
|
37
|
-
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(get_bloginfo("name")) . ' » コメントフィード" href="' . get_feed_link() . '?feed=comments-rss2" />'
|
37
|
+
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(get_bloginfo("name")) . ' » コメントフィード" href="' . get_feed_link() . '?feed=comments-rss2" />';
|
38
38
|
}
|
39
39
|
add_action( 'wp_head', 'lf_custom_feeds_alternate' );
|
40
40
|
```
|
2
追記
answer
CHANGED
@@ -25,11 +25,13 @@
|
|
25
25
|
の2つが呼ばれるからです。
|
26
26
|
|
27
27
|
今回質問者様の内容から2行目のhrefにURLパラメータが無いという事なので
|
28
|
+
functions.phpの
|
28
29
|
```
|
29
30
|
add_theme_support('automatic-feed-links');
|
30
31
|
```
|
31
32
|
の箇所を
|
32
33
|
```
|
34
|
+
// add_theme_support('automatic-feed-links');
|
33
35
|
add_action( 'wp_head', 'feed_links', 2 );
|
34
36
|
function lf_custom_feeds_alternate() {
|
35
37
|
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(get_bloginfo("name")) . ' » コメントフィード" href="' . get_feed_link() . '?feed=comments-rss2" />'
|
1
追記
answer
CHANGED
@@ -1,2 +1,39 @@
|
|
1
1
|
[【WordPress】人気ブログランキングの最新記事の表示方法](https://kokesshiblog.com/ninkiblogranking-wp/)
|
2
|
-
こちらが参考になるかと...
|
2
|
+
こちらが参考になるかと...
|
3
|
+
|
4
|
+
追記
|
5
|
+
[WordPress add_theme_support() で実装される機能](https://qiita.com/gatespace/items/d6419b0b7e49c98ce829)
|
6
|
+
```
|
7
|
+
add_theme_support('automatic-feed-links');
|
8
|
+
```
|
9
|
+
これを実行すると
|
10
|
+
> <link rel="alternate" type="application/rss+xml" title="サイト名 » フィード" href="サイトのURL" />
|
11
|
+
> <link rel="alternate" type="application/rss+xml" title="サイト名 » コメントフィード" href="サイトのURL" />
|
12
|
+
|
13
|
+
の2行が作成されます。
|
14
|
+
|
15
|
+
[WordPressのフィードに関する覚え書き](https://gatespace.jp/2012/10/16/wordpress-feeds/)
|
16
|
+
これは
|
17
|
+
```
|
18
|
+
add_theme_support('automatic-feed-links');
|
19
|
+
```
|
20
|
+
を実行した際
|
21
|
+
```
|
22
|
+
add_action( 'wp_head', 'feed_links', 2 );
|
23
|
+
add_action( 'wp_head', 'feed_links_extra', 3 );
|
24
|
+
```
|
25
|
+
の2つが呼ばれるからです。
|
26
|
+
|
27
|
+
今回質問者様の内容から2行目のhrefにURLパラメータが無いという事なので
|
28
|
+
```
|
29
|
+
add_theme_support('automatic-feed-links');
|
30
|
+
```
|
31
|
+
の箇所を
|
32
|
+
```
|
33
|
+
add_action( 'wp_head', 'feed_links', 2 );
|
34
|
+
function lf_custom_feeds_alternate() {
|
35
|
+
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(get_bloginfo("name")) . ' » コメントフィード" href="' . get_feed_link() . '?feed=comments-rss2" />'
|
36
|
+
}
|
37
|
+
add_action( 'wp_head', 'lf_custom_feeds_alternate' );
|
38
|
+
```
|
39
|
+
と書き換えてみて下さい。
|