ワードプレスのアイキャッチ画像の大きさが足りなくて表示が崩れてしまいます。
大きいを入れた場合は一定の大きさで止まって綺麗に表示されるのですが、そもそもの画像の大きさが足りないとその分詰まってしまって綺麗に表示されません。。。
ワードプレス側の設定でなんとかできれば一番良いのですが、何か方法はありますでしょうか??( ; ; )
php
1<tbody> 2 <?php 3 while(have_posts()):the_post(); 4 5 // 登録されている作品 6 $worksData=0; 7 $args = array( 8 'post_type' => 'works', 9 'posts_per_page' => -1, 10 'meta_query' => array( 11 array( 12 'key' => 'place2_0_placePost', 13 'value' => get_the_ID() 14 ), 15 array( 16 'key' => 'place2_1_placePost', 17 'value' => get_the_ID() 18 ), 19 array( 20 'key' => 'place2_2_placePost', 21 'value' => get_the_ID() 22 ), 23 array( 24 'key' => 'place2_3_placePost', 25 'value' => get_the_ID() 26 ), 27 array( 28 'key' => 'place2_4_placePost', 29 'value' => get_the_ID() 30 ), 31 array( 32 'key' => 'place2_5_placePost', 33 'value' => get_the_ID() 34 ), 35 array( 36 'key' => 'place2_6_placePost', 37 'value' => get_the_ID() 38 ), 39 array( 40 'key' => 'place2_7_placePost', 41 'value' => get_the_ID() 42 ), 43 array( 44 'key' => 'place2_8_placePost', 45 'value' => get_the_ID() 46 ), 47 array( 48 'key' => 'place2_9_placePost', 49 'value' => get_the_ID() 50 ), 51 'relation' => 'OR' 52 ) 53 ); 54 $the_query = get_posts($args); 55 if($the_query): global $post; 56 foreach($the_query as $post): setup_postdata($post); 57 58 $worksData++; 59 60 endforeach; endif; 61 wp_reset_postdata(); 62 ?> 63 <tr> 64 <th class="title"> 65 <div class="img1"><?php 66 if(has_post_thumbnail()){ 67 the_post_thumbnail('160-132-crop'); 68 }else{ 69 echo '<img src="'.get_bloginfo('template_directory').'/img/common/noimage_100-82.png" width="60" height="50" alt="" />'; 70 } 71 ?></div> 72 <h3><?php 73 $title = strip_tags(get_the_title()); 74 if(mb_strlen($title)>15){$title = mb_substr($title, 0, 15)."...";} 75 echo '<a href="'.get_the_permalink().'">'.$title.'</a>'; 76 ?></h3> 77 </th> 78 <td class="place"><?php the_field('pref'); ?> | <?php the_field('type'); ?></td> 79 <td class="current"><?php echo $worksData; ?>点</td> 80 </tr> 81 <?php endwhile; ?> 82 </tbody>
css
1.p-place__list-gallery li a { 2 display: block; 3 color: #000; 4 border: 1px solid #F2F2F2; 5 border-radius: 3px; 6 box-shadow: 0 2px 0 #F2F2F2; 7 text-decoration: none; 8 9.p-place__list-gallery li .img1 img { 10 border-radius: 3px 3px 0 0; 11}
それともやはりフォトショップなどで画像の大きさを調整してからアップロードみたいな作業が必要になってくるのでしょうか?? お手数おかけしますが、回答お待ちしてます( ; ; )