FacetWP - 如何把客户订单通过(FacetWP - how to put custom o

2019-11-04 18:15发布

我创建使用豆荚管理和FacetWP确实显示和网页过滤自定义字段。

但我需要“按订单”更改为所谓的“沃尔特 - 利必达节奏的”自定义字段。

像这样:

<?php
    return array(
      "post_type" => "volta_rapida",
      "post_status" => "publish",
      "orderby" => "volta-rapida-tempo",
      "order" => "ASC",
      "posts_per_page" => 10
    );

我怎么能这样做是否正确?

谢谢

Answer 1:

你需要做2个变化首先发生变化的OrderBy meta_value并添加meta_key请检查下面的代码相同。

 <?php
    return array(
    "post_type" => "volta_rapida",
    "post_status" => "publish",
    "meta_key" => "volta-rapida-tempo",
    "orderby"           => "meta_value",
    "order" => "ASC",
    "posts_per_page" => 10
  );


文章来源: FacetWP - how to put custom order by