如何在wordpress之外使用woocommerce功能 [英] How to use woocommerce functions outside of wordpress
本文介绍了如何在wordpress之外使用woocommerce功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 wordpress 之外使用 woocommerce 功能.我已包含以下代码以在 wordpress 之外使用 wordpress 函数:
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');
?
我还需要包含哪些其他代码才能访问 woocommerce 功能?
What other code do i have to include so woocommerce functions are accessible?
推荐答案
只需在要使用 WooCommerce/WordPress 功能的文件中包含 wp-load.php 就足够了(只要网站设置正确).
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).
这篇关于如何在wordpress之外使用woocommerce功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文