現在、カスタムフィールドを導入するためにCustom Post Type UI
を導入し、Advanced Custom Fieldsを使用してカスタムフィールドを作りました。
カスタム投稿にカスタムフィールドを表示させるところまではいきましたが
そこに何を入力しても投稿ページに反映されません。
UTF
1<?php get_header(2); ?> 2<section id="post_area" class="container"> 3<?php query_posts('&post_type=home&paged='.$paged); ?> 4 <?php if ( have_posts() ) : ?> 5 <?php while ( have_posts() ) : the_post(); ?> 6 <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> 7 <?php the_content(); ?> 8 9 <?php get_field('place'); ?> 10 11 <?php endwhile; ?> 12 <?php endif; ?> 13</section> 14<div class="clear"></div> 15</div> 16<?php get_footer(); ?>
こちらのplaceに表示させたいのですが、タイトルなどは表示されていますが、カスタムフィールドの内容は表示されません。
書き方が悪いのでしょうか?
ご享受お願いいたします。
追記
UTF
1<?php get_header(2); ?> 2<section id="post_area" class="container"> 3<?php query_posts('&post_type=home&paged='.$paged); ?> 4 <?php if ( have_posts() ) : ?> 5 <?php while ( have_posts() ) : the_post(); ?> 6 <div class="custom_img"><? 7) 8$img = get_field('img'); 9$imgurl = wp_get_attachment_image_src($img, 'full'); 10if($imgurl){ ?><img src="<? echo $imgurl[0]; ?>" alt=""></p> 11<? } ?></div> 12 <div class="custom_table"> 13 <div class="custom_title_area"><?php the_field('choice'); ?><h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2></div> 14 <?php the_content(); ?> 15 <?php the_field('place'); ?> 16 17 <?php endwhile; ?> 18 <?php endif; ?> 19</section> 20<div class="clear"></div> 21</div> 22<?php get_footer(); ?>
現在ここまできたのですが、間に画像や、タイトルタグを挟んでいるのですが、書き方はこちらであっているのでしょうか?
とりぜず出力はされているのですが、おかしいところがあれば指摘お願いいたします。
回答1件
あなたの回答
tips
プレビュー