行业新闻

    wordpress get terms根据所选术语更改 wordpress 循环

    2022-06-12    来源:www.8001717.cn

    我有一个页面 page-.php 其中所有(帖子类型“”)。你可以在这个网址上看到页面:

    在页面的左侧wordpress get terms,您必须 .这些是帖子类型“”的术语。

     false, 'orderby' => 'term_group', 'parent' => false);
      $terms = get_terms('product_categorie', $args);
      $hierarchy = _get_term_hierarchy('product_categorie');
    

    wordpress wp terms_wordpress get terms_get terms

    echo '
      '; foreach ($terms as $term) { echo '
    • '.$term->name.''; if (array_key_exists($term->term_id, $hierarchy)) { echo '
        '; foreach ($hierarchy[$term->term_id] as $v) {

        wordpress wp terms_get terms_wordpress get terms

        $child = get_term($v); echo '
      • '.$child->name.'
      • '; } echo '
      '; } echo '
    • ';

      wordpress wp terms_get terms_wordpress get terms

      } echo '
    '; ?>

    所有的都用这个代码显示:

     'product'); ?>
    

    wordpress get terms_get terms_wordpress wp terms

    have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?>

    wordpress wp terms_get terms_wordpress get terms

    但是我如何能够查询子项?因此wordpress网站建设,如果我单击“”一词wordpress get termswordpress做网站,我只想显示“”一词。

    文章来自互联网,侵权请联系删除,文章阐述观点来自文章出处,并不代表本站观点。 www.8001717.cn



X