Php 获取术语缩略图

Php 获取术语缩略图,php,wordpress,woocommerce,Php,Wordpress,Woocommerce,我已经设法找到了获取属性术语名称的方法工作的代码是这样的我意识到global$product现在没有做任何事情,如下所示: global $product; $terms = get_terms("pa_melamine"); foreach ( $terms as $term ) { echo "<option>" . $term->name . "</option>"; } 我正在尝试获取附加到属性项的缩略图,它们是样例。我不知道如何才能获取缩略

我已经设法找到了获取属性术语名称的方法工作的代码是这样的我意识到global$product现在没有做任何事情,如下所示:

global $product;

$terms = get_terms("pa_melamine");

foreach ( $terms as $term ) {
  echo "<option>" . $term->name . "</option>";
}   
我正在尝试获取附加到属性项的缩略图,它们是样例。我不知道如何才能获取缩略图附件


如果有人需要更多信息,请告诉我。

您如何向属性术语添加缩略图?这不是WooCommerce核心的一部分。你是说附加到每个变体的缩略图吗?啊,它被添加到元中。它是名为Woocommerce Visual Attributes的插件的一部分。插件的前端部分可以在上面的php文件中找到。你能在你的问题中发布相关部分吗?甚至不确定我在代码中的相关内容,我也不确定我需要拉什么。我的理解是,我在dropbox中链接的代码将缩略图插入到woocommerce属性的元中?但我不确定我在那里做了什么
  public 'term_id' => string '69' (length=2)
  public 'name' => string 'Bistro' (length=6)
  public 'slug' => string 'bistro' (length=6)
  public 'term_group' => string '0' (length=1)
  public 'term_taxonomy_id' => string '69' (length=2)
  public 'taxonomy' => string 'pa_melamine' (length=11)
  public 'description' => string '' (length=0)
  public 'parent' => string '0' (length=1)
  public 'count' => string '1' (length=1)
  public 'meta_id' => string '85' (length=2)
  public 'woocommerce_term_id' => string '69' (length=2)
  public 'meta_key' => string 'order_pa_melamine' (length=17)
  public 'meta_value' => string '0' (length=1)