Get the_excerpt() outside of the loop using post ID

WordPress’s the_excerpt() can be useful outside of the loop, for example, with the wp_recent_posts function. Here is a function you can add to your WordPress theme’s functions.php file to get your excerpts to load!

 

You can call the function in your theme template files by using the following code snippet: