For a homepage template I'm trying to query a custom post type with a couple custom meta boxes. They are a title, oembed text field, and text area. I've compiled the below code from various sources as I piece together what I need for this homepage.
The result on the front end is currently a blank white screen. The custom post type and metaboxes add/edit/save fine on their own. It's just when I have this homepage template code in there that it's blank.
Any ideas?
<?php
/*
Template Name: Homepage
*/
/*
@package _tk
*/
get_header(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php $args = array( 'post_type' => 'films', 'posts_per_page' => 12 );
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php /* Get the current post ID. */
global $post;
$post_id = $post->ID;
/* If we have a post ID, proceed. */
if ( !empty( $post_id ) ) { ?>
<h2><?php the_title(); ?></h2>
<div class="film_wrap"><?php echo wp_oembed_get( esc_html( get_post_meta( $post_id, $prefix . 'film_embed', true ) ) ); ?></div>
<?php if ( get_post_meta( $post_id, $prefix . 'film_textarea', true ) ) : ?>
<div class="film_description">
<p><?php echo get_post_meta( $post_id, $prefix . 'film_textarea', true ); ?></p>
</div>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
<?php } else { ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php } ?>
<?php wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', '_tk' ),
'after' => '</div>',
) ); ?>
<?php endwhile; ?>
</div><!-- .entry-content -->
<?php edit_post_link( __( 'Edit', '_tk' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?>
</article><!-- #post-## -->
<?php wp_reset_query(); ?>
<?php get_footer(); ?>
The error message I get from WP_DEBUG is:
Parse error: syntax error, unexpected end of file in /myhost/test/wp-content/themes/ianrigby/homepage.php on line 54