質問編集履歴

1

コードの詳細を追加いたしました。

2019/05/10 07:12

投稿

UKYO9311
UKYO9311

スコア31

test CHANGED
File without changes
test CHANGED
@@ -28,24 +28,198 @@
28
28
 
29
29
  ```php
30
30
 
31
+ <tbody>
32
+
33
+ <?php
34
+
35
+ while(have_posts()):the_post();
36
+
37
+
38
+
39
+ // 登録されている作品
40
+
41
+ $worksData=0;
42
+
43
+ $args = array(
44
+
45
+ 'post_type' => 'works',
46
+
47
+ 'posts_per_page' => -1,
48
+
49
+ 'meta_query' => array(
50
+
51
+ array(
52
+
53
+ 'key' => 'place2_0_placePost',
54
+
55
+ 'value' => get_the_ID()
56
+
57
+ ),
58
+
59
+ array(
60
+
61
+ 'key' => 'place2_1_placePost',
62
+
63
+ 'value' => get_the_ID()
64
+
65
+ ),
66
+
67
+ array(
68
+
69
+ 'key' => 'place2_2_placePost',
70
+
71
+ 'value' => get_the_ID()
72
+
73
+ ),
74
+
75
+ array(
76
+
77
+ 'key' => 'place2_3_placePost',
78
+
79
+ 'value' => get_the_ID()
80
+
81
+ ),
82
+
83
+ array(
84
+
85
+ 'key' => 'place2_4_placePost',
86
+
87
+ 'value' => get_the_ID()
88
+
89
+ ),
90
+
91
+ array(
92
+
93
+ 'key' => 'place2_5_placePost',
94
+
95
+ 'value' => get_the_ID()
96
+
97
+ ),
98
+
99
+ array(
100
+
101
+ 'key' => 'place2_6_placePost',
102
+
103
+ 'value' => get_the_ID()
104
+
105
+ ),
106
+
107
+ array(
108
+
109
+ 'key' => 'place2_7_placePost',
110
+
111
+ 'value' => get_the_ID()
112
+
113
+ ),
114
+
115
+ array(
116
+
117
+ 'key' => 'place2_8_placePost',
118
+
119
+ 'value' => get_the_ID()
120
+
121
+ ),
122
+
123
+ array(
124
+
125
+ 'key' => 'place2_9_placePost',
126
+
127
+ 'value' => get_the_ID()
128
+
129
+ ),
130
+
131
+ 'relation' => 'OR'
132
+
133
+ )
134
+
135
+ );
136
+
137
+ $the_query = get_posts($args);
138
+
139
+ if($the_query): global $post;
140
+
141
+ foreach($the_query as $post): setup_postdata($post);
142
+
143
+
144
+
145
+ $worksData++;
146
+
147
+
148
+
149
+ endforeach; endif;
150
+
151
+ wp_reset_postdata();
152
+
153
+ ?>
154
+
155
+ <tr>
156
+
157
+ <th class="title">
158
+
31
- <div class="img1"><?php
159
+ <div class="img1"><?php
32
-
160
+
33
- if(has_post_thumbnail()){
161
+ if(has_post_thumbnail()){
34
-
162
+
35
- the_post_thumbnail('253-180');
163
+ the_post_thumbnail('160-132-crop');
36
-
164
+
37
- }else{
165
+ }else{
38
-
166
+
39
- echo '<img src="'.get_bloginfo('template_directory').'/img/common/noimage_253-180.png" width="255" height="180" alt="" />';
167
+ echo '<img src="'.get_bloginfo('template_directory').'/img/common/noimage_100-82.png" width="60" height="50" alt="" />';
40
-
168
+
41
- }
169
+ }
42
-
170
+
43
- ?></div>
171
+ ?></div>
172
+
173
+ <h3><?php
174
+
175
+ $title = strip_tags(get_the_title());
176
+
177
+ if(mb_strlen($title)>15){$title = mb_substr($title, 0, 15)."...";}
178
+
179
+ echo '<a href="'.get_the_permalink().'">'.$title.'</a>';
180
+
181
+ ?></h3>
182
+
183
+ </th>
184
+
185
+ <td class="place"><?php the_field('pref'); ?> | <?php the_field('type'); ?></td>
186
+
187
+ <td class="current"><?php echo $worksData; ?>点</td>
188
+
189
+ </tr>
190
+
191
+ <?php endwhile; ?>
192
+
193
+ </tbody>
44
194
 
45
195
  ```
46
196
 
47
197
 
48
198
 
49
-
199
+ ```css
200
+
201
+ .p-place__list-gallery li a {
202
+
203
+ display: block;
204
+
205
+ color: #000;
206
+
207
+ border: 1px solid #F2F2F2;
208
+
209
+ border-radius: 3px;
210
+
211
+ box-shadow: 0 2px 0 #F2F2F2;
212
+
213
+ text-decoration: none;
214
+
215
+
216
+
217
+ .p-place__list-gallery li .img1 img {
218
+
219
+ border-radius: 3px 3px 0 0;
220
+
221
+ }
222
+
223
+ ```
50
224
 
51
225
  それともやはりフォトショップなどで画像の大きさを調整してからアップロードみたいな作業が必要になってくるのでしょうか?? お手数おかけしますが、回答お待ちしてます( ; ; )