So I have a static page for the news page in wordpress, and its featured image as a breadcrumb image. I query it with this: <?php the_post_thumbnail_url(get_option('page_for_posts')); ?>
. The problem is this function for whatever reason outputs the featured image of the first post instead of the featured image for the posts page.
My entire home.php
looks like this (with irrelevant html code cut out)
<?php get_header(); ?>
<?php the_post_thumbnail_url(get_option('page_for_posts')); ?>
<?php
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>
<!-- code for the posts -->
<?php
endwhile; endif;
?>
<?php get_footer(); ?>
'page_on_front'
codex.wordpress.org/Option_Reference