Sean Breeden

Full Stack PHP, Python, AI/ML Developer
"Saruman believes it is only great power that can hold evil in check, but that is not what I have found. I found it is the small everyday deeds of ordinary folk that keep the darkness at bay. Small acts of kindness and love." --Gandalf

StackOverflow question answered: How to include WordPress functions in custom .php file?

Tuesday, May 11th, 2021

profile for seanbreeden on Stack Exchange, a network of free, community-driven Q&A sites

I answered this question on StackOverflow way back in March 2013 and it still gets views and upvotes today.

The question:

My answer:


If you've found this page because you're looking at a way to include Wordpress in an external PHP file, then this is your lucky day! The answer is:

$path = "/home/yourhome/public_html/wp"; // <--- This is the path to your Wordpress installation.
require_once($path . "/wp-load.php");

Views: 1161
| Home | Announcements | Artificial Intelligence | Commodore 64 | CraftCMS | Crypto | Games | Geek | Machine Learning | Magento | Memes | Science News | Security | 7 Days to Die | Ubuntu |