While working with wordpress, sometimes we want to use wordpress functions out of it. In most of the cases, we need this when we want to fetch latest wordpress posts to show on another website which is not in wordpress. As we know that wordpress is widely used for blogs because it is best blogging CMS among others, sometimes we built a website in PHP and a blog in wordpress on same domain. So, in these type of cases we want to show our latest posts from wordpress to any of the section of the main PHP website.

So, to do this we need to use wp-load.php file at the place where we want to call the wordpress functions like this :

 
<?php
require_once( '../wordpress_root_directory/wp-load.php' ) //put correct absolute path for this file
get_header();

/* Use other wordpress functions here as per your choice */

get_footer();
?>

This wp-load.php will provide a wordpress environment to use theme functions as well as all other wordpress functions. Now we can work here as we are working in wordpress with the use of its predefined functions. This is the simple way to use wordpress functions outside of wordpress, but I prefer the Best way to use wordpress functions outside of wordpress by calling wp-blog-header.php because it will automatically load wp-load.php as well.

Above mentioned approach is easy and light weight to get the same functionality.