Last active
February 12, 2018 05:55
-
-
Save senooat/63a2221e1f8cdd498a81568ec468ab40 to your computer and use it in GitHub Desktop.
Advanced Custom Fieldsを使ったテンプレートサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: 会社概要用 | |
*/ | |
?> | |
<?php get_header(); ?> | |
<main class="main"> | |
<?php if (have_posts()): while (have_posts()) : the_post(); ?> | |
<article id="post-<?php the_ID(); ?>" class="pages"> | |
<section class="pages__ttl"> | |
<?php the_title( '<h1><span class="ttl02">', '</span></h1>' ); ?> | |
<p><?php edit_post_link(); ?></p> | |
</section> | |
<section class="pages__body"> | |
<table> | |
<tr> | |
<th>会社名</th> | |
<td><?php the_field('company'); ?></td> | |
</tr> | |
<tr> | |
<th>設立日</th> | |
<td><?php the_field('ymd'); ?></td> | |
</tr> | |
<tr> | |
<th>資本金</th> | |
<td><?php the_field('money'); ?></td> | |
</tr> | |
<tr> | |
<th>所在地</th> | |
<td><?php the_field('addr'); ?></td> | |
</tr> | |
<tr> | |
<th>業務内容</th> | |
<td><?php the_field('service'); ?></td> | |
</tr> | |
<tr> | |
<th>地図</th> | |
<td> | |
<?php $location = get_field('map'); if( !empty($location) ): ?> | |
<iframe src="http://maps.google.co.jp/maps?q=<?php echo $location['address']; ?>&output=embed" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe> | |
<?php endif; ?> | |
</td> | |
</tr> | |
</table> | |
</section> | |
<nav class="pages__nav"> | |
<?php previous_post_link("%link", "< %title"); ?> | |
<?php next_post_link("%link", "%title >"); ?> | |
</nav> | |
</article> | |
<?php endwhile;endif; ?> | |
</main> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment