Skip to content

Instantly share code, notes, and snippets.

@krasenslavov
Last active April 26, 2020 15:41
Show Gist options
  • Save krasenslavov/53812f7b9568a3972cffc823e9f9d8c8 to your computer and use it in GitHub Desktop.
Save krasenslavov/53812f7b9568a3972cffc823e9f9d8c8 to your computer and use it in GitHub Desktop.
CPT UI + Advanced Custom Fields + Front-end data collection form. Visit blog post https://bit.ly/2KwpDWK
<?php
// Single page to display each restaurant.
get_header();
?>
<main id="site-content" role="main">
<div class="page type-page status-publish hentry">
<div class="post-inner thin">
<div class="entry-content">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
$photo = get_field('photo', get_the_ID());
?>
<h3><?php echo get_field('business_name', get_the_ID());?></h3>
<p><?php echo get_field('address', get_the_ID());?></p>
<img src="<?php echo $photo['sizes']['medium_large'];?>" alt="" />
<h4>Working Hours</h4>
<p><?php echo get_field('working_hours', get_the_ID());?></p>
<h4>Short Description</h4>
<p><?php echo get_field('short_description', get_the_ID());?></p>
<?php
}
}
?>
</div>
</div>
</div>
</main>
<?php
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment