将Wordpress自定义分类链接添加到PAge

时间:2017-03-08 20:27:47

标签: wordpress woocommerce custom-taxonomy hook-woocommerce

我在名为“产品类型”的woocommerce产品下创建了一个自定义分类。我想将产品类型类别的链接添加到单个产品页面的页面元数据,类似于已经存在的类别链接。

如何检索分配给产品的产品类型的名称和链接?

我知道它应该进入/低于

<?php echo $product->get_categories( ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', $cat_count, 'woocommerce' ) . ' ', '</span>' ); ?>

yourtheme / single-product / meta.php

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

试试这个:

 Traceback (most recent call last):   File "/usr/local/bin/pyresttest",
 line 4, in <module>
     __import__('pkg_resources').run_script('pyresttest==1.7.2.dev0', 'pyresttest')   File
 "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py",
 line 739, in run_script
     self.require(requires)[0].run_script(script_name, ns)   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py",
 line 1494, in run_script
     exec(code, namespace, namespace)   File "/usr/local/lib/python2.7/site-packages/pyresttest-1.7.2.dev0-py2.7.egg/EGG-INFO/scripts/pyresttest",
 line 4, in <module>
     resttest.command_line_run(sys.argv[1:])   File "/usr/local/lib/python2.7/site-packages/pyresttest-1.7.2.dev0-py2.7.egg/pyresttest/resttest.py",
 line 914, in command_line_run
     main(args)   File "/usr/local/lib/python2.7/site-packages/pyresttest 1.7.2.dev0-py2.7.egg/pyresttest/resttest.py",
 line 815, in main
     register_extensions(extensions)   File "/usr/local/lib/python2.7/site-packages/pyresttest-1.7.2.dev0-py2.7.egg/pyresttest/resttest.py",
 line 748, in register_extensions
     module = __import__(ext, globals(), locals(), package) ImportError: No module named date

我不是专家,但我认为这样可行