I have a new custom post type set up that will be where an online copy of our email newsletter lives, like any web-based archive of newsletters.
I am trying to create a conditional statement to add to the custom post type's single.php template so that on the most recent post, additional content is displayed.
The purpose of this is so that we can email subscribers a link to the latest newsletter for them to view on the website, which would include relevant ads and news above and below the content. Why? Because on newsletters that are NOT the very latest issue, the ads and news is irrelevant, and shouldn't be displayed.
Is there a way I can query my single.php template loop to only display content on the most recent post in this post-type?
Something like:
if ( is_most_recent_post('post_type=newsletter') ) {
echo 'Content that shows up only in the most recent post in the Newsletter post type is output here.';
}
I know that function doesn't actually exists. It's hypothetical code. I hope this makes sense - thanks in advance for the tips!