lundi 21 décembre 2015

Using groupby and join in FacetWP

I am using Facet WP to filter search results in Wordpress. I have a table with companies and a table with the companies' establishments. I want the search results to display the establishments, not the companies. However, I do want the user to be able to filter the establishments using the company information. (For instance a user can pick a company type, and it would show all locations linked to companies of this type).

It seems that all I can edit is the query args of the WP-query:

return array(
  "post_type" => array('establishment', 'company'),
  "post_status" => "publish",
  "orderby" => "date",
  "order" => "DESC",
  "posts_per_page" => 10
); 

What happens now is that, in the results, both the companies and establishments are listed in a long list instead of just the establishments. How can I accomplish that FacetWP lists only the establishments, but does filter by the companies?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire