What is the correct way to use WordPress functions outside WordPress files?

Posted by Prem Tiwari | Updated on

There’s little difference between the files. When you view a WordPress page, the first file called is index.php. And it is, essentially, your “Method 1:”

The blog header file (that queues up the rest of WordPress) loads wp-load.php directly and fires up WordPress itself. Here’s most of wp-blog-header.php:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers