Looper Provider based on field value

Is it possible to determine a looper provider based on a field value of a post type.

For example:
I want the provider to be a specific post type and show only posts that have “status”(custom field) = “active”(field value) AND “type”(custom field) = “sale”(field value).

It would be like the Taxonomy option, except singling out posts with specific field values instead.

Hi @marketfresh,

Thanks for reaching out.
Regretfully, there is no such option available in Looper Provider, but you can use the Custom option to call a custom method that will help you to get the data inside it. Please find the following thread which may help you on this.


Thanks

@kory posts were definitely getting me closer to what I wanted.

Here’s exactly what I’m trying to do:
post_type=listing&meta_key=ffd_listingtype&meta_value=Sale&meta_key=ffd_status&meta_value!=Closed

Basically I want to use 2 meta key values (both need to be true so it needs to be AND, not OR) to determine which posts to show, and one of the values needs to be not “Closed”.

Does this make sense, and is it even possible?

I think I figured it out after looking a little harder at some of @kory’s posts.
Here’s what I did:

$query = array(
  'post_type'           => 'listing’,
  'post_status'         => 'publish',
  'orderby'             => 'date',
  'order'               => 'DESC',
  'meta_query'           => array(
    'relation' => 'AND',
    array(
      'key' => 'ffd_status',
      'value'    => 'Closed',
      'operator' => 'NOT IN',
    ),
    array(
      'key' => 'ffd_listingtype',
      'value'    => 'Sale',
      'operator' => 'IN',
    ),
  ),
);

var_dump( http_build_query( $query ) );

Here’s the output:
post_type=listing&post_status=publish&orderby=date&order=DESC&meta_query%5Brelation%5D=AND&meta_query%5B0%5D%5Bkey%5D=ffd_status&meta_query%5B0%5D%5Bvalue%5D=Closed&meta_query%5B0%5D%5Boperator%5D=NOT+IN&meta_query%5B1%5D%5Bkey%5D=ffd_listingtype&meta_query%5B1%5D%5Bvalue%5D=Sale&meta_query%5B1%5D%5Boperator%5D=IN

Hi @marketfresh,

We’re glad that you’re able to figure it out. If you have any other concerns regarding our theme features, feel free to reach us.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.