How to use woocommerce functions outside of wordpr

2019-08-18 03:22发布

I want to use woocommerce functions outside of wordpress. I have included the code below to use wordpress functions outside of wordpress:

 <?php
 require_once(dirname(__FILE__) . '/../../../wp-load.php');
require(dirname(__FILE__) . '/../../../wp-blog-header.php');
?

What other code do i have to include so woocommerce functions are accessible?

1条回答
一纸荒年 Trace。
2楼-- · 2019-08-18 03:31

Simply including the wp-load.php in the file you want to use the WooCommerce/WordPress functionality is enough (as long as the website is properly set up).

查看更多
登录 后发表回答