質問編集履歴
2
ソースの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -222,86 +222,110 @@
|
|
222
222
|
|
223
223
|
|
224
224
|
|
225
|
-
<div id="side_bar">
|
226
|
-
|
227
|
-
<ul class="course">
|
228
|
-
|
229
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_04.png"></a></li>
|
230
|
-
|
231
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_05.png"></a></li>
|
232
|
-
|
233
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_06.png"></a></li>
|
234
|
-
|
235
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_07.png"></a></li>
|
236
|
-
|
237
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_08.png"></a></li>
|
238
|
-
|
239
|
-
</ul>
|
240
|
-
|
241
|
-
<ul class="banner">
|
242
|
-
|
243
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_03.png"></a></li>
|
244
|
-
|
245
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_04.png"></a></li>
|
246
|
-
|
247
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_05.png"></a></li>
|
248
|
-
|
249
|
-
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_06.png" style="margin-right:-8px"></a></li>
|
250
|
-
|
251
|
-
</ul>
|
252
|
-
|
253
|
-
</div>
|
254
|
-
|
255
225
|
</div><!-- #ページ名 -->
|
256
226
|
|
257
227
|
|
258
228
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
<
|
280
|
-
|
281
|
-
<
|
229
|
+
</div><!-- #content -->
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<?php get_footer();?>
|
234
|
+
|
235
|
+
```
|
236
|
+
|
237
|
+
###該当部分のソース
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
```html
|
242
|
+
|
243
|
+
<div class="contents">
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
<div class="content">
|
248
|
+
|
249
|
+
<img src="http://xxxx/wp-content/themes/xxxx/shared/images/top_news_02.png" class="newstag">
|
250
|
+
|
251
|
+
<p class="date">2016/05/29</p>
|
252
|
+
|
253
|
+
<h4><a href="http://xxxx/news/%e4%bd%b5%e8%a8%ad%e3%83%8d%e3%82%a4%e3%83%ab%e3%82%b5%e3%83%ad%e3%83%b3%e5%90%8d%e5%a4%89%e6%9b%b4%e3%81%ae%e3%81%94%e6%a1%88%e5%86%85/">タイトル</a></h4>
|
254
|
+
|
255
|
+
<p class="text"><a href="http://xxxx/news/%e4%bd%b5%e8%a8%ad%e3%83%8d%e3%82%a4%e3%83%ab%e3%82%b5%e3%83%ad%e3%83%b3%e5%90%8d%e5%a4%89%e6%9b%b4%e3%81%ae%e3%81%94%e6%a1%88%e5%86%85/"><p>本文</a></p>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<div class="content">
|
264
|
+
|
265
|
+
<img src="http://xxxx/wp-content/themes/xxxx/shared/images/top_news_02.png" class="newstag">
|
266
|
+
|
267
|
+
<p class="date">2016/05/18</p>
|
268
|
+
|
269
|
+
<h4><a href="http://xxxx/news/%e6%a0%a1%e8%88%8e%e7%a7%bb%e8%bb%a2%e3%81%ae%e3%81%94%e6%a1%88%e5%86%85/">タイトル</a></h4>
|
270
|
+
|
271
|
+
<p class="text"><a href="http://xxxx/news/%e6%a0%a1%e8%88%8e%e7%a7%bb%e8%bb%a2%e3%81%ae%e3%81%94%e6%a1%88%e5%86%85/"><p>本文</a></p>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
<div class="content">
|
280
|
+
|
281
|
+
<img src="http://xxxx/wp-content/themes/xxxx/shared/images/top_news_02.png" class="newstag">
|
282
|
+
|
283
|
+
<p class="date">2016/05/02</p>
|
284
|
+
|
285
|
+
<h4><a href="http://xxxx/news/%e5%88%9d%e5%bf%83%e8%80%85%e3%81%a7%e3%82%82%e5%a4%a7%e4%b8%88%e5%a4%ab%e2%98%86-%ef%bc%91day%e3%80%90%e3%82%bb%e3%83%ab%e3%83%95%e3%83%8d%e3%82%a4%e3%83%ab%e4%bd%93%e9%a8%93%e3%83%ac%e3%83%83/">タイトル</a></h4>
|
286
|
+
|
287
|
+
<p class="text"><a href="http://xxxx/news/%e5%88%9d%e5%bf%83%e8%80%85%e3%81%a7%e3%82%82%e5%a4%a7%e4%b8%88%e5%a4%ab%e2%98%86-%ef%bc%91day%e3%80%90%e3%82%bb%e3%83%ab%e3%83%95%e3%83%8d%e3%82%a4%e3%83%ab%e4%bd%93%e9%a8%93%e3%83%ac%e3%83%83/"><p><a href="http://ameblo.jp/xxxxtry-12153897623.html">本文</a></p>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
<div class="content">
|
296
|
+
|
297
|
+
<img src="http://xxxx/wp-content/themes/xxxx/shared/images/top_news_02.png" class="newstag">
|
298
|
+
|
299
|
+
<p class="date">2016/05/02</p>
|
300
|
+
|
301
|
+
<h4><a href="http://xxxx/news/%e3%80%90%e5%b9%b3%e6%97%a5%e6%98%bc%e5%89%b2%e3%80%91%e3%83%bb%e3%80%90%e3%81%a8%e3%82%82%e5%89%b2%e3%80%91%e3%81%ae%e3%81%94%e6%a1%88%e5%86%85/">タイトル</a></h4>
|
302
|
+
|
303
|
+
<p class="text"><a href="http://xxxx/news/%e3%80%90%e5%b9%b3%e6%97%a5%e6%98%bc%e5%89%b2%e3%80%91%e3%83%bb%e3%80%90%e3%81%a8%e3%82%82%e5%89%b2%e3%80%91%e3%81%ae%e3%81%94%e6%a1%88%e5%86%85/"><p>本文<a href="http://ameblo.jp/xxxxtry-12146682084.html">本文リンクテキスト</a></p...</a></p>
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
<div class="content">
|
312
|
+
|
313
|
+
<img src="http://xxxx/wp-content/themes/xxxx/shared/images/top_news_02.png" class="newstag">
|
314
|
+
|
315
|
+
<p class="date">2016/05/02</p>
|
316
|
+
|
317
|
+
<h4><a href="http://xxxx/news/%ef%bd%87%ef%bd%97%e3%82%ad%e3%83%a3%e3%83%b3%e3%83%9a%e3%83%bc%e3%83%b3%e5%ae%9f%e6%96%bd%e4%b8%ad%ef%bc%81/">タイトル</a></h4>
|
318
|
+
|
319
|
+
<p class="text"><a href="http://xxxx/news/%ef%bd%87%ef%bd%97%e3%82%ad%e3%83%a3%e3%83%b3%e3%83%9a%e3%83%bc%e3%83%b3%e5%ae%9f%e6%96%bd%e4%b8%ad%ef%bc%81/"><p>本文<a href="http://ameblo.jp/xxxxtry-12154802979.html">本文リンクテキスト</a...</a></p>
|
320
|
+
|
321
|
+
</div>
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
282
326
|
|
283
327
|
</div>
|
284
328
|
|
285
|
-
</div>
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
<
|
329
|
+
<!-- /.contents -->
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
<?php get_footer();?>
|
298
330
|
|
299
331
|
```
|
300
|
-
|
301
|
-
###検証画面のスクリーンショット
|
302
|
-
|
303
|
-
URLは修正しましたが同じ当校記事の中にあるリンクが複数生成されてしまいます。
|
304
|
-
|
305
|
-
http://...となっているところが該当箇所です。
|
306
|
-
|
307
|
-
![検証画面](81e4f42d315a9194cb0cce9ae88f88d6.png)
|
1
コードと検証画面の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,3 +9,299 @@
|
|
9
9
|
投稿記事内のaタグが別の場所にも自動で生成されてしまいます。
|
10
10
|
|
11
11
|
これを止めるにはどうしたらいいでしょうか。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
###記述コード
|
18
|
+
|
19
|
+
category.php
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
```php
|
24
|
+
|
25
|
+
<?php get_header();?>
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
<div id="content">
|
30
|
+
|
31
|
+
<div id="newslist" class="clrFix"><!-- #ページ名 -->
|
32
|
+
|
33
|
+
<ul id="pankuzu" class="clrFix">
|
34
|
+
|
35
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/pankuzu_home.png"></a></li>
|
36
|
+
|
37
|
+
<li>></li>
|
38
|
+
|
39
|
+
<li>お知らせ</li>
|
40
|
+
|
41
|
+
</ul>
|
42
|
+
|
43
|
+
<h2><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/newslist_title_01.png" alt="News"></h2>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
<?php
|
48
|
+
|
49
|
+
$category = get_the_category();
|
50
|
+
|
51
|
+
$cat_name = $category[0]->cat_name; //カテゴリー名
|
52
|
+
|
53
|
+
$cat_slug = $category[0]->category_nicename; //スラッグ名
|
54
|
+
|
55
|
+
?>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<div id="main">
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<div class="tabwrap">
|
66
|
+
|
67
|
+
<div class="tabinner">
|
68
|
+
|
69
|
+
<ul id="tab">
|
70
|
+
|
71
|
+
<li id="newstab"><h3><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/newslist_ico_01_on.png" class="ico on">
|
72
|
+
|
73
|
+
<img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/newslist_ico_01_off.png" class="ico off" style="display:none;">News一覧</h3></li>
|
74
|
+
|
75
|
+
<li id="schooltab" class="center"><h3><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/newslist_ico_02_on.png" class="ico on" style="display:none;">
|
76
|
+
|
77
|
+
<img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/newslist_ico_02_off.png" class="ico off">スクール情報</h3></li>
|
78
|
+
|
79
|
+
<li id="salontab"><h3><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/newslist_ico_03_on.png" class="ico on" style="display:none;">
|
80
|
+
|
81
|
+
<img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/newslist_ico_03_off.png" class="ico off">サロン情報</h3></li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
|
85
|
+
<!-- /#tab -->
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<!-- #wrapper -->
|
90
|
+
|
91
|
+
<div id="wrapper">
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<!-- .contents -->
|
96
|
+
|
97
|
+
<div class="contents">
|
98
|
+
|
99
|
+
<?php if(have_posts()): ?>
|
100
|
+
|
101
|
+
<?php while(have_posts()): ?>
|
102
|
+
|
103
|
+
<?php the_post(); ?>
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<div class="content">
|
108
|
+
|
109
|
+
<img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_news_0<?php $category=get_the_category(); $cat_slug=$category[0]->category_nicename; if($cat_slug=='news'){echo "2";}elseif($cat_slug=='nailschool'){echo "3";}elseif($cat_slug=='nailsalon'){echo "1";}?>.png" class="newstag">
|
110
|
+
|
111
|
+
<p class="date"><?php the_time('Y/m/d'); ?></p>
|
112
|
+
|
113
|
+
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
|
114
|
+
|
115
|
+
<p class="text"><a href="<?php the_permalink(); ?>"><?php echo mb_substr($post->post_content,0, 100).'...';?></a></p>
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<?php endwhile; ?>
|
122
|
+
|
123
|
+
<?php endif; ?>
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<!-- /.contents -->
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<!-- .contents -->
|
132
|
+
|
133
|
+
<div class="contents">
|
134
|
+
|
135
|
+
<?php query_posts("cat=3"); ?>
|
136
|
+
|
137
|
+
<?php if(have_posts()): ?>
|
138
|
+
|
139
|
+
<?php while(have_posts()): ?>
|
140
|
+
|
141
|
+
<?php the_post(); ?>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<div class="content">
|
146
|
+
|
147
|
+
<img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_news_03.png" class="newstag">
|
148
|
+
|
149
|
+
<p class="date"><?php the_time('Y/m/d'); ?></p>
|
150
|
+
|
151
|
+
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
|
152
|
+
|
153
|
+
<p class="text"><a href="<?php the_permalink();?>"><?php echo mb_substr($post->post_content,0, 100).'...';?></a></p>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<?php endwhile; ?>
|
160
|
+
|
161
|
+
<?php endif; ?>
|
162
|
+
|
163
|
+
<?php wp_reset_query(); ?>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<!-- /.contents -->
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<!-- .contents -->
|
176
|
+
|
177
|
+
<div class="contents">
|
178
|
+
|
179
|
+
<?php query_posts("cat=4"); ?>
|
180
|
+
|
181
|
+
<?php if(have_posts()): ?>
|
182
|
+
|
183
|
+
<?php while(have_posts()): ?>
|
184
|
+
|
185
|
+
<?php the_post(); ?>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<div class="content">
|
190
|
+
|
191
|
+
<img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_news_01.png" class="newstag">
|
192
|
+
|
193
|
+
<p class="date"><?php the_time('Y/m/d'); ?></p>
|
194
|
+
|
195
|
+
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
|
196
|
+
|
197
|
+
<p class="text"><a href="<?php the_permalink();?>"><?php echo mb_substr($post->post_content,0, 100).'...';?></a></p>
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<?php endwhile; ?>
|
204
|
+
|
205
|
+
<?php endif; ?>
|
206
|
+
|
207
|
+
<?php wp_reset_query(); ?>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<!-- /.contents -->
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
</div><!-- /#wrapper -->
|
216
|
+
|
217
|
+
</div><!-- /#tabinner -->
|
218
|
+
|
219
|
+
</div><!-- /#tabwrapper -->
|
220
|
+
|
221
|
+
</div><!-- #main -->
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<div id="side_bar">
|
226
|
+
|
227
|
+
<ul class="course">
|
228
|
+
|
229
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_04.png"></a></li>
|
230
|
+
|
231
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_05.png"></a></li>
|
232
|
+
|
233
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_06.png"></a></li>
|
234
|
+
|
235
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_07.png"></a></li>
|
236
|
+
|
237
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_pic_08.png"></a></li>
|
238
|
+
|
239
|
+
</ul>
|
240
|
+
|
241
|
+
<ul class="banner">
|
242
|
+
|
243
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_03.png"></a></li>
|
244
|
+
|
245
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_04.png"></a></li>
|
246
|
+
|
247
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_05.png"></a></li>
|
248
|
+
|
249
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/top_banner_06.png" style="margin-right:-8px"></a></li>
|
250
|
+
|
251
|
+
</ul>
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</div><!-- #ページ名 -->
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<div id="common">
|
260
|
+
|
261
|
+
<div class="contact_box">
|
262
|
+
|
263
|
+
<h2><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_ico_01.jpg" class="ico">資料請求・体験入学のお申し込みはこちらから</h2>
|
264
|
+
|
265
|
+
<ul class="btn_box clrFix">
|
266
|
+
|
267
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_btn_01.jpg" alt="資料請求はこちら" onmouseover="this.src='<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_btn_01_active.png'" onmouseout="this.src='<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_btn_01.jpg'"></a></li>
|
268
|
+
|
269
|
+
<li><a href="#"><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_btn_02.jpg" alt="見学・体験入学のお申し込み" onmouseover="this.src='<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_btn_02_active.png'" onmouseout="this.src='<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_btn_02.jpg'"></a></li>
|
270
|
+
|
271
|
+
</ul>
|
272
|
+
|
273
|
+
<h2><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_ico_02.jpg" class="ico">お電話でのお問い合わせはコチラから</h2>
|
274
|
+
|
275
|
+
<ul class="phone">
|
276
|
+
|
277
|
+
<li><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_ico_03.jpg">0800-805-8216</li>
|
278
|
+
|
279
|
+
<li><img src="<?php echo esc_url(get_template_directory_uri());?>/shared/images/common_ico_04.jpg">03-3518-6753</li>
|
280
|
+
|
281
|
+
</ul>
|
282
|
+
|
283
|
+
</div>
|
284
|
+
|
285
|
+
</div>
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
</div><!-- #content -->
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<?php get_footer();?>
|
298
|
+
|
299
|
+
```
|
300
|
+
|
301
|
+
###検証画面のスクリーンショット
|
302
|
+
|
303
|
+
URLは修正しましたが同じ当校記事の中にあるリンクが複数生成されてしまいます。
|
304
|
+
|
305
|
+
http://...となっているところが該当箇所です。
|
306
|
+
|
307
|
+
![検証画面](81e4f42d315a9194cb0cce9ae88f88d6.png)
|