我创建了一个名为foods的自定义类型和一个名为fruits的分类法。我想按字母顺序排列水果名称(A-Z),单击按钮,然后再次单击它,它将显示Z-A顺序。
你能告诉我怎么做吗?
我创建了一个名为foods的自定义类型和一个名为fruits的分类法。我想按字母顺序排列水果名称(A-Z),单击按钮,然后再次单击它,它将显示Z-A顺序。
你能告诉我怎么做吗?
单击链接时在url中传递订单参数,如/?order=DESC或如果您使用的是按钮,则它必须提交一个带有order字段值change GET to POST和字段名的表单
if(isset($_GET[\'order\'])){
$order = $_GET[\'order\'];
}
else{
$order = \'ASC\';
}
$categories = get_terms( \'category\', array(
\'orderby\' => \'name\',
\'order\'=> $order,
) );
我试图列出与特定分类法相关的所有产品。由于某些原因,尝试访问时模板无法工作“http://www.myexample.com/product_categories/funiture/“,我试过了taxonomy.php, taxonomy-term.php 什么都没有。这是我的代码:http://pastie.org/7934453add_action(\'init\', \'register_cpt_product\'); function register_cpt_product()