質問編集履歴

3

コードを囲むを追加修正

2017/01/16 22:29

投稿

totaminotuyu
totaminotuyu

スコア12

test CHANGED
File without changes
test CHANGED
@@ -28,8 +28,12 @@
28
28
 
29
29
  サイズを変更しても下記ソースで出力されてしまいます。⇓
30
30
 
31
+ ```ここに言語を入力
32
+
31
33
  <img width="150" height="150" src="http://amami-setouti.com/wp/wp-content/uploads/s-P1150005-150x150.jpg" class="attachment-thumbnail size-thumbnail" alt="たんかん4" /><img width="150" height="150" src="http://amami-setouti.com/wp/wp-content/uploads/s-P1150013-150x150.jpg" class="attachment-thumbnail size-thumbnail" alt="たんかん5" /> </div>
32
34
 
35
+ ```
36
+
33
37
 
34
38
 
35
39
  ----------------------------------------

2

wordpressのタグ追加とコードをコードブロックで囲みました。失礼いたしました。後、教えていただいたWordPress Codexを見てみます。

2017/01/16 22:29

投稿

totaminotuyu
totaminotuyu

スコア12

test CHANGED
File without changes
test CHANGED
@@ -42,6 +42,8 @@
42
42
 
43
43
 
44
44
 
45
+ ```ここに言語を入力
46
+
45
47
  <?php
46
48
 
47
49
  $term_id = get_query_var('cat');
@@ -60,6 +62,8 @@
60
62
 
61
63
  ?>
62
64
 
65
+ ```
66
+
63
67
 
64
68
 
65
69
  ------------------------------------
@@ -108,6 +112,8 @@
108
112
 
109
113
 
110
114
 
115
+ ```ここに言語を入力
116
+
111
117
  <?php
112
118
 
113
119
  /**
@@ -364,6 +370,8 @@
364
370
 
365
371
  <?php get_footer(); ?>
366
372
 
373
+ ```
374
+
367
375
 
368
376
 
369
377
  ---------------------------------------------

1

補足情報と実際のソースコードです。

2017/01/16 21:39

投稿

totaminotuyu
totaminotuyu

スコア12

test CHANGED
File without changes
test CHANGED
@@ -17,3 +17,359 @@
17
17
 
18
18
 
19
19
  宜しくお願い致します。
20
+
21
+
22
+
23
+ ------------------------------------------
24
+
25
+ 発生している問題・エラーメッセージ
26
+
27
+
28
+
29
+ サイズを変更しても下記ソースで出力されてしまいます。⇓
30
+
31
+ <img width="150" height="150" src="http://amami-setouti.com/wp/wp-content/uploads/s-P1150005-150x150.jpg" class="attachment-thumbnail size-thumbnail" alt="たんかん4" /><img width="150" height="150" src="http://amami-setouti.com/wp/wp-content/uploads/s-P1150013-150x150.jpg" class="attachment-thumbnail size-thumbnail" alt="たんかん5" /> </div>
32
+
33
+
34
+
35
+ ----------------------------------------
36
+
37
+ 該当のソースコード
38
+
39
+
40
+
41
+ miz様よりご回答頂いたソースコード↓
42
+
43
+
44
+
45
+ <?php
46
+
47
+ $term_id = get_query_var('cat');
48
+
49
+
50
+
51
+ $objects = SCF::get_term_meta( $term_id, 'category', '商品紹介' );
52
+
53
+
54
+
55
+ foreach ( $objects as $object ) {
56
+
57
+ echo wp_get_attachment_image( $object['scfimg'] );
58
+
59
+ }
60
+
61
+ ?>
62
+
63
+
64
+
65
+ ------------------------------------
66
+
67
+ 補足情報(言語/FW/ツール等のバージョンなど)
68
+
69
+
70
+
71
+ wordpressバージョン → WordPress 4.7.1
72
+
73
+ テーマ → WelcartBasicの子テーマ Welcart Nova
74
+
75
+
76
+
77
+ Smart Custom Fieldsの
78
+
79
+ フィールド名 → ギャラリー
80
+
81
+ グループ名 → 商品紹介
82
+
83
+ タイプ → 画像
84
+
85
+ 名前 → scfimg
86
+
87
+ ラベル → scfimg
88
+
89
+
90
+
91
+ サブフィールドの
92
+
93
+ タイプ → テキスト
94
+
95
+ 名前 → txt
96
+
97
+ ラベル → txt
98
+
99
+
100
+
101
+ ---------------------------------------
102
+
103
+ Welcart Nova: カテゴリーテンプレート (category.php)
104
+
105
+ の中身です。
106
+
107
+ 現在は</div><!-- #content -->の上に画像出力させています。
108
+
109
+
110
+
111
+ <?php
112
+
113
+ /**
114
+
115
+ * @package Welcart
116
+
117
+ * @subpackage Welcart_Basic
118
+
119
+ */
120
+
121
+ get_header();?>
122
+
123
+
124
+
125
+ <div id="primary" class="site-content">
126
+
127
+
128
+
129
+ <?php
130
+
131
+ $term_img = $term_class = $term_before = $term_after = '';
132
+
133
+ $term_id = get_query_var( 'cat' );
134
+
135
+ $term_img_url = get_term_meta( $term_id, 'wcct-tag-thumbnail-url', true );
136
+
137
+ if( ! empty( $term_img_url ) ) {
138
+
139
+ $term_img = '<p class="taxonomy-img"><img src="' . get_term_meta( $term_id, 'wcct-tag-thumbnail-url', true ) . '"></p>';
140
+
141
+ }
142
+
143
+ if( wcct_get_options( 'cat_image' ) && ! empty( $term_img_url ) ) {
144
+
145
+ $term_class = ' over';
146
+
147
+ $term_before = '<div class="wrap"><div class="inner">';
148
+
149
+ $term_after = '</div></div>';
150
+
151
+ }
152
+
153
+ ?>
154
+
155
+ <div class="page-header<?php echo $term_class; ?>">
156
+
157
+ <?php
158
+
159
+ echo $term_img;
160
+
161
+ echo $term_before;
162
+
163
+ the_archive_title( '<h1 class="page-title">', '</h1>' );
164
+
165
+ the_archive_description( '<div class="taxonomy-description">', '</div>' );
166
+
167
+ echo $term_after;
168
+
169
+ ?>
170
+
171
+ </div><!-- .page-header -->
172
+
173
+ <div class="content-wrapper">
174
+
175
+ <div id="content" role="main">
176
+
177
+
178
+
179
+ <?php if( usces_is_cat_of_item( $term_id ) ): ?>
180
+
181
+
182
+
183
+ <?php if (have_posts()) : ?>
184
+
185
+
186
+
187
+ <div class="cat-il type-grid">
188
+
189
+
190
+
191
+ <?php while (have_posts()) : the_post(); ?>
192
+
193
+ <article id="post-<?php the_ID(); ?>">
194
+
195
+
196
+
197
+ <div class="itemimg">
198
+
199
+ <a href="<?php the_permalink(); ?>">
200
+
201
+ <?php usces_the_itemImage( 0, 300, 300 ); ?>
202
+
203
+ <?php if( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ): ?>
204
+
205
+ <div class="itemsoldout">
206
+
207
+ <div class="inner">
208
+
209
+ <?php _e('SOLD OUT', 'welcart_basic_nova' ); ?>
210
+
211
+ <?php if( wcct_get_options( 'display_inquiry' ) ): ?>
212
+
213
+ <span class="text"><?php wcct_options( 'display_inquiry_text' ); ?></span>
214
+
215
+ <?php endif; ?>
216
+
217
+ </div>
218
+
219
+ </div>
220
+
221
+ <?php endif; ?>
222
+
223
+ </a>
224
+
225
+ </div>
226
+
227
+ <?php wcct_produt_tag(); ?>
228
+
229
+ <?php welcart_basic_campaign_message(); ?>
230
+
231
+ <div class="item-info-wrap">
232
+
233
+ <div class="itemname"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php usces_the_itemName(); ?></a></div>
234
+
235
+ <div class="itemprice"><?php usces_crform( usces_the_firstPrice('return'), true, false ) . usces_guid_tax(); ?></div>
236
+
237
+ </div><!-- item-info-box -->
238
+
239
+
240
+
241
+ </article>
242
+
243
+ <?php endwhile; ?>
244
+
245
+
246
+
247
+ </div><!-- .cat-il -->
248
+
249
+
250
+
251
+ <?php else: ?>
252
+
253
+
254
+
255
+ <p class="no-date"><?php echo __('No posts found.', 'usces'); ?></p>
256
+
257
+
258
+
259
+ <?php endif; ?>
260
+
261
+
262
+
263
+ <?php else : ?>
264
+
265
+
266
+
267
+ <?php if (have_posts()) : ?>
268
+
269
+
270
+
271
+ <div class="post-li">
272
+
273
+ <?php while (have_posts()) : the_post(); ?>
274
+
275
+ <article id="post-<?php the_ID(); ?>">
276
+
277
+ <?php if ( has_post_thumbnail() ): ?>
278
+
279
+ <div class="thumb-img"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></div>
280
+
281
+ <?php endif; ?>
282
+
283
+ <p><time datetime="<?php the_time('c'); ?>"><?php the_time(__('Y/m/d')) ?></time></p>
284
+
285
+ <div class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'welcart_basic' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a></div>
286
+
287
+ <?php the_excerpt() ?>
288
+
289
+ </article>
290
+
291
+ <?php endwhile; ?>
292
+
293
+ </div>
294
+
295
+
296
+
297
+ <?php else: ?>
298
+
299
+
300
+
301
+ <p class="no-date"><?php echo __('No posts found.', 'usces'); ?></p>
302
+
303
+
304
+
305
+ <?php endif; ?>
306
+
307
+
308
+
309
+ <?php endif; ?>
310
+
311
+
312
+
313
+ <div class="pagination_wrapper">
314
+
315
+ <?php
316
+
317
+ $args = array (
318
+
319
+ 'type' => 'list',
320
+
321
+ 'prev_text' => __( ' &laquo; ', 'welcart_basic' ),
322
+
323
+ 'next_text' => __( ' &raquo; ', 'welcart_basic' ),
324
+
325
+ );
326
+
327
+ echo paginate_links( $args );
328
+
329
+ ?>
330
+
331
+ </div><!-- .pagenation-wrapper -->
332
+
333
+ <?php
334
+
335
+ $term_id = get_query_var('cat');
336
+
337
+
338
+
339
+ $objects = SCF::get_term_meta( $term_id, 'category', '商品紹介' );
340
+
341
+
342
+
343
+ foreach ( $objects as $object ) {
344
+
345
+ echo wp_get_attachment_image( $object['scfimg'] );
346
+
347
+ }
348
+
349
+ ?>
350
+
351
+ </div><!-- #content -->
352
+
353
+
354
+
355
+ <?php get_sidebar(); ?>
356
+
357
+ </div><!-- .content-wrapper -->
358
+
359
+
360
+
361
+ </div><!-- #primary -->
362
+
363
+
364
+
365
+ <?php get_footer(); ?>
366
+
367
+
368
+
369
+ ---------------------------------------------
370
+
371
+ カテゴリーページのhttpアドレスです。
372
+
373
+
374
+
375
+ http://amami-setouti.com/category/item/tankan/