I am trying to display data from a custom post type on my home page, for which I am using a separate template.
I'm getting a Fatal error: Call to undefined method WP_Query::have_post() when my code looks like this:
get_header(); ?>
<div class="home_main_text">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'home' ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #primary -->
<?php
$current = date("d/m/Y");
$args = array('post_type' => 'jh_dedications');
$loop = new WP_Query($args);
while ( $loop -> have_post() ) : $loop->the_post();
the_title();
endwhile;
?>