To display the latest sermon in your theme, you can use the php code below in your template file. This is especially useful for the home page of your site.
<?php // Setting up the Query - see http://codex.wordpress.org/Class_Reference/WP_Query $latest_sermon = new WP_Query(array( 'post_type' => 'wpfc_sermon', 'posts_per_page' => 1, 'post_status' => 'publish', // Do you want to limit it to a specific service type? Use the service type slug to do it: // More info here: http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters 'wpfc_service_type' => 'sunday-am', // The last three parameters will optimize your query 'no_found_rows' => true, 'update_post_term_cache' => false, 'update_post_meta_cache' => false )); if ($latest_sermon->have_posts()) : ?> <?php while ($latest_sermon->have_posts()) : $latest_sermon->the_post(); ?> <?php global $post; ?> <div id="latest_sermon"> <a id="latest_sermon_title" title="<?php echo esc_attr( get_the_title() ); ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a> <span class="meta"> <?php wpfc_sermon_meta('bible_passage', '<span class="bible_passage">'.__( 'Bible Text: ', 'sermon-manager'), '</span> | '); wpfc_sermon_date(get_option('date_format')); ?> </span> <?php // this will output the media links ?> <?php wpfc_sermon_files(); ?> </div> <?php endwhile; ?> <?php // reset the $post variable like below: ?> <?php wp_reset_postdata(); ?> <?php endif; ?>