I'm developing a WordPress theme. I am selecting one post as a 'featured post' from the customizer settings. I want to display this post differently on home page. I'm using following code to get the post on home.php:
$featured_post = get_post( get_theme_mod( 'featured_post_id' ) );
This code works perfectly to get the post. But, after selecting this post as a featured post, if I trash it, it still gets displayed as a featured post on home page. If I 'Delete it Permanently', it doesn't get displayed.
How do I use
get_post() to get the post that is not trashed?