Support

Account

Home Forums General Issues How to Display Groups of Custom Posts by Two Factors

Unread

How to Display Groups of Custom Posts by Two Factors

  • Hi,

    I’ve been reading this tutorial:
    http://www.advancedcustomfields.com/resources/querying-relationship-fields/

    I’m not sure if the relationship field is the best thing for what I’m trying to do so here’s what I’m trying to do. Would love some advice.

    I have two pages:

    1. Cars
    2. Trucks

    “Cars” lists two groups of posts:

    1. Red
      1. Car 1
      2. Car 2
      3. Camino 1
    2. Blue
      1. Post 3

    “Trucks” lists two groups of posts:

    1. Red
      1. Truck 1
      2. Truck 2
      3. Camino 1
    2. Blue
      1. Truck 3

    So for the cars page, for example, I think I want to query for the post_type of vehicles and the meta_value of vehicle_type for the meta_key of cars.

    But then how do I separate list of posts into groups by the field color and head each group by that field’s value (Red, for example)?

Viewing 1 post (of 1 total)

The topic ‘How to Display Groups of Custom Posts by Two Factors’ is closed to new replies.