我正在尝试在 WooCommerce 仪表板上向客户显示最后 3 个订单。但get_template()根本不起作用并且什么也不显示。
我还尝试将orders.php表单放入dashboard.php模板文件中,但这里没有显示任何订单,而我已经有一些活动订单。我很困惑,不知道这个问题。
这是我的仪表板代码:
<?php get_header();?>
<?php
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce\Templates
* @version 4.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$allowed_html = array(
'a' => array(
'href' => array(),
),
);
?>
<p>
<!-- <?php
printf(
/* translators: 1: user display name 2: logout url */
wp_kses( __( 'Hello %1$s (not %1$s? <a href="%2$s">Log out</a>)', 'woocommerce' ), $allowed_html ), …Run Code Online (Sandbox Code Playgroud)