質問編集履歴
6
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -74,10 +74,6 @@
|
|
74
74
|
|
75
75
|
<script src="js/jquery-3.2.1.min.js"></script>
|
76
76
|
|
77
|
-
<!-- Global site tag (gtag.js) - Google Analytics -->
|
78
|
-
|
79
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111373095-1"></script>
|
80
|
-
|
81
77
|
<title>aaaaaaaa</title>
|
82
78
|
|
83
79
|
</head>
|
5
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,20 +78,6 @@
|
|
78
78
|
|
79
79
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111373095-1"></script>
|
80
80
|
|
81
|
-
<script>
|
82
|
-
|
83
|
-
window.dataLayer = window.dataLayer || [];
|
84
|
-
|
85
|
-
function gtag(){dataLayer.push(arguments);}
|
86
|
-
|
87
|
-
gtag('js', new Date());
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
gtag('config', 'UA-111373095-1');
|
92
|
-
|
93
|
-
</script>
|
94
|
-
|
95
81
|
<title>aaaaaaaa</title>
|
96
82
|
|
97
83
|
</head>
|
4
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -53,3 +53,201 @@
|
|
53
53
|
</article>
|
54
54
|
|
55
55
|
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
「ソース全体」
|
60
|
+
|
61
|
+
```ここに言語を入力
|
62
|
+
|
63
|
+
<?php require('./news/wp-load.php'); ?>
|
64
|
+
|
65
|
+
<!DOCTYPE HTML>
|
66
|
+
|
67
|
+
<html>
|
68
|
+
|
69
|
+
<head>
|
70
|
+
|
71
|
+
<meta charset="UTF-8">
|
72
|
+
|
73
|
+
<link rel="stylesheet" type="text/css" href="css/top_style.css">
|
74
|
+
|
75
|
+
<script src="js/jquery-3.2.1.min.js"></script>
|
76
|
+
|
77
|
+
<!-- Global site tag (gtag.js) - Google Analytics -->
|
78
|
+
|
79
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111373095-1"></script>
|
80
|
+
|
81
|
+
<script>
|
82
|
+
|
83
|
+
window.dataLayer = window.dataLayer || [];
|
84
|
+
|
85
|
+
function gtag(){dataLayer.push(arguments);}
|
86
|
+
|
87
|
+
gtag('js', new Date());
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
gtag('config', 'UA-111373095-1');
|
92
|
+
|
93
|
+
</script>
|
94
|
+
|
95
|
+
<title>aaaaaaaa</title>
|
96
|
+
|
97
|
+
</head>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<body>
|
102
|
+
|
103
|
+
<!-- main_box -->
|
104
|
+
|
105
|
+
<section id="main_box" class="clearfix">
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<!-- box1 -->
|
110
|
+
|
111
|
+
<article class="box1">
|
112
|
+
|
113
|
+
<p><img src="img/title1.png" width="560" height="138" alt="ピックアップ"></p>
|
114
|
+
|
115
|
+
<div class="box_txt">
|
116
|
+
|
117
|
+
<p><img src="img/p.jpg" width="560" height="250" alt="ピックアップ画像"></p>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
</article>
|
122
|
+
|
123
|
+
<!-- box1 -->
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
<!-- box3 -->
|
128
|
+
|
129
|
+
<article class="box3">
|
130
|
+
|
131
|
+
<p><img src="img/title3.png" width="330" height="138" alt="youtube"></p>
|
132
|
+
|
133
|
+
<div class="box_txt">
|
134
|
+
|
135
|
+
<?php
|
136
|
+
|
137
|
+
$url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC-1QaEudvHG6K8iZOOQmWEQ";
|
138
|
+
|
139
|
+
$rss = file_get_contents($url);
|
140
|
+
|
141
|
+
$rss = preg_replace("/<([^>]+?):(.+?)>/", "<$1_$2>", $rss);
|
142
|
+
|
143
|
+
$rss = simplexml_load_string($rss,'SimpleXMLElement',LIBXML_NOCDATA);
|
144
|
+
|
145
|
+
foreach($rss->entry as $value):
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
?>
|
150
|
+
|
151
|
+
<?php
|
152
|
+
|
153
|
+
print($rss);
|
154
|
+
|
155
|
+
?>
|
156
|
+
|
157
|
+
<iframe width="322" height="247" src="https://www.youtube.com/embed/<?php echo htmlspecialchars($value->yt_videoId, ENT_QUOTES, 'UTF-8') ?>" frameborder="0" allowfullscreen></iframe>
|
158
|
+
|
159
|
+
<?php break; endforeach; ?>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
</article>
|
164
|
+
|
165
|
+
<!-- box3 -->
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
</section>
|
172
|
+
|
173
|
+
<!-- main_box -->
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<!-- sub_box -->
|
178
|
+
|
179
|
+
<section id="sub_box" class="clearfix">
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<!-- box2 -->
|
184
|
+
|
185
|
+
<article class="box2">
|
186
|
+
|
187
|
+
<p><img src="img/title2.png" width="560" height="138" alt="ニュース"></p>
|
188
|
+
|
189
|
+
<div class="box_txt">
|
190
|
+
|
191
|
+
<ul class="wp">
|
192
|
+
|
193
|
+
<?php
|
194
|
+
|
195
|
+
$posts = get_posts("numberposts=5&category=3&orderby=post_date&offset=0");
|
196
|
+
|
197
|
+
foreach ($posts as $post):
|
198
|
+
|
199
|
+
setup_postdata($post);
|
200
|
+
|
201
|
+
?>
|
202
|
+
|
203
|
+
<li>
|
204
|
+
|
205
|
+
<p>
|
206
|
+
|
207
|
+
<?php the_time('Y.m.d') ?>
|
208
|
+
|
209
|
+
:<a href="<?php the_permalink() ?>">
|
210
|
+
|
211
|
+
<?php the_title() ?>
|
212
|
+
|
213
|
+
</a></p>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
<?php endforeach; ?>
|
218
|
+
|
219
|
+
</ul>
|
220
|
+
|
221
|
+
<p class="article_p"><a href="http://aaaaaaaa.jp/news/category/new/">ニュース一覧</a></p>
|
222
|
+
|
223
|
+
</div>
|
224
|
+
|
225
|
+
</article>
|
226
|
+
|
227
|
+
<!-- box2 -->
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<!-- box4 -->
|
232
|
+
|
233
|
+
<article class="box4">
|
234
|
+
|
235
|
+
<p><img src="img/title4.png" width="330" height="138" alt="ツイッター"></p>
|
236
|
+
|
237
|
+
<p class="box_txt"><a class="twitter-timeline" width="330px" height="250px" href="https://twitter.com/aaaaaaaaa?ref_src=twsrc%5Etfw">Tweets by aaaaaaaa</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></p>
|
238
|
+
|
239
|
+
</article>
|
240
|
+
|
241
|
+
<!-- box4 -->
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</section>
|
246
|
+
|
247
|
+
<!-- sub_box -->
|
248
|
+
|
249
|
+
</body>
|
250
|
+
|
251
|
+
</html>
|
252
|
+
|
253
|
+
```
|
3
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,6 +7,10 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
解決策をアドバイス頂けると幸いです。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
参考にしたサイト:[https://sakic.jp/blog/web/latest-youtube-channel](https://sakic.jp/blog/web/latest-youtube-channel)
|
10
14
|
|
11
15
|
|
12
16
|
|
2
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,6 +7,12 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
解決策をアドバイス頂けると幸いです。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
「現象」
|
14
|
+
|
15
|
+
![イメージ説明](ea4ecd9e7fb271f03af31f3bd825c663.jpeg)
|
10
16
|
|
11
17
|
|
12
18
|
|
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
下記は、youtubeの自分のチャンネルの最新動画を表示させるソースです。
|
2
2
|
|
3
|
-
これをサーバにアップするとなぜかPHPの一部が表示されて、動画が再生できず。
|
3
|
+
これをサーバにアップするとなぜかウェブサイト上にPHPの一部が表示されて、動画が再生できず。
|
4
4
|
|
5
5
|
エラーが発生しましたと動画に表示されてしまいます。
|
6
6
|
|