Support

Account

Home Forums Feedback How to use ACF as an page specific filter?

Solving

How to use ACF as an page specific filter?

  • Hello,

    I’m very new to the ACF and wordpress, but I’m trying my best to crawl out of the obstacles that my concept brings.

    This is my initial design and thought on how I’m trying to use ACF and currently with the Select field.

    I’m creating a Custom Post and creating a list of people that is assigned to different teams (Select Field)
    screenshot: http://grab.by/DN18

    From there, I’m trying to query the Custom page and want to display only the specific people with the assigned team that matches with the page title.

    Is it possible to do this?

    Thank you in advance.

  • The following snippet gets all posts from a custom posttype “peoples” where the value of the ACF Field “assigned_team” is equal to the posts name.

    $results = get_posts(array(
        'numberposts' => -1,
        'post_status' => 'any',
        'post_type' => 'peoples',
        'meta_query' => array(
            array(
                'key' => 'assigned_team',
                'value' => $post->post_name
            )
        )
    ));

    Is this what you are looking for?

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘How to use ACF as an page specific filter?’ is closed to new replies.