获取Woocommerce属性术语缩略图

时间:2015-02-10 16:12:50

标签: php wordpress woocommerce

我已经设法弄清楚如何获取属性术语名称,有效的代码就是这个(我意识到全球$ product产品现在没有做任何事情):

global $product;

$terms = get_terms("pa_melamine");

foreach ( $terms as $term ) {
  echo "<option>" . $term->name . "</option>";
}   

当我转储$ terms时,我得到了这个:

  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)

我正在尝试获取我已附加到属性术语的缩略图图像,它们是样本。我不知道如何获取缩略图附件。

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

0 个答案:

没有答案