Hello
I am having an issue with creating a post template for an “events” custom post type i have created.
I am using ACF to additional fields for the event information and have my child-theme set up and activated.
I have copied the wp-single.php file over to pro-child/views/icon/ and made modifications according to the documentation on ACF’s site.
It seems like wordpress is ignoring the template.
you can see the post page here.
https://staging.warmdocs.com/wp/events/test/
<?php
// =============================================================================
/*
* Template Name: Event Article
* Template Post Type: events
*/
// -----------------------------------------------------------------------------
// VIEWS/ICON/WP-SINGLE.PHP
// -----------------------------------------------------------------------------
// Single post output for Icon.
// =============================================================================
$fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );
// vars
$location = get_field('location');
$thumbnail = get_field('event_image');
?>
<?php get_header(); ?>
<div class="x-main full" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<div id="event-hero">
<?php if( $location ): ?>
<div id="event-map" class="acf-map">
<div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div>
</div>
<?php endif; ?>
<?php if( $thumbnail ): ?>
<img class="thumbnail" src="<?php echo $thumbnail['url']; ?>" alt="<?php echo $thumbnail['alt']; ?>" />
<?php endif; ?>
<h2><?php the_title(); ?></h2>
<h3><?php the_field('date'); ?> from <?php the_field('start_time'); ?> to <?php the_field('end_time'); ?></h3>
<h4><?php echo $location['address']; ?></h4>
</div>
<?php x_get_view( 'icon', 'content', get_post_format() ); ?>
<?php x_get_view( 'global', '_comments-template' ); ?>
<?php endwhile; ?>
</div>
<?php if ( $fullwidth != 'on' ) : ?>
<?php get_sidebar(); ?>
<?php endif; ?>
<?php get_footer(); ?>