以下のコードで<?php endfor; ?>の部分がparse errorになってしまいます。
forの始まりはコロンで、終わりはセミコロンであっているはずですが、
解決できません。
{}にしてみてもエラーです。
よろしくお願いいたします。
php
1<?php 2get_header(); 3?> 4<h1 style="color:#000;">東京エリア</h1> 5<div id="gmap" style="width: 500px; height: 300px;"></div> 6<?php if(have_posts()): ?> 7 <?php while(have_posts()): ?> 8 <?php the_post(); ?> 9 <?php 10 $field = post_custom('field');//グループカウント 11 $currency_img = post_custom('currency_img');//国旗 12 $currency = post_custom('currency');//通貨 13 $rate = post_custom('rate');//レート 14 $details = post_custom('details');//詳細 15 if($field == 1){ 16 $currency_img = array($currency_img); 17 $currency = array($currency); 18 $rate = array($rate); 19 $details = array($details); 20 } 21 ?> 22 23 <?php for($i=0; $i<$field; $i++): ?> 24 <?php 25 $thumbnail_url = wp_get_attachment_image_src($currency_img[$i]); 26 ?> 27 <li> 28 <p> 29 <img src="<?php echo $thumbnail_url[0]; ?>"> 30 </p> 31 <p><?php echo $currency[$i]; ?></p> 32 <p><?php echo $rate[$i]; ?></p> 33 <p><?php echo $details[$i]; ?></p> 34 </li> 35 <?php endfor; ?> 36 37 <script> 38 $(window).load(function(){ 39 gmapPins( 40 "<?php echo post_custom('latlng'); ?>", 41 "<?php echo post_custom('name'); ?>", 42 "pg-R", 43 "<?php echo get_template_directory_uri(); ?>/images/icons/twitter.png" 44 ); 45 }); 46 </script> 47 48 <?php endwhile; ?> 49<?php endif; ?> 50<script> 51 $(window).load(function(){initialize('<?php echo get_template_directory_uri(); ?>/images/icons/twitter.png');}); 52</script> 53 54<?php get_footer(); ?>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。