<?php
global $wpdb;
$item_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='asp-products' AND post_status='publish'" );
echo "<p>商品数: {$item_count}</p>";
?>
<?php
global $wpdb;
$item_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='asp-products' AND post_status='publish'" );
echo "<p>商品数: {$item_count}</p>";
?>