Support

Account

Home Forums Backend Issues (wp-admin) Can you insert a field group as a select field?

Solved

Can you insert a field group as a select field?

  • Hey guys,

    I saw a similar topic posted on the wordpress.org forums but couldn’t find the solution I am looking for. What I am looking to do is create a select field that has individual field groups as its choices. Here is the situation…

    I have designed a testimonial page for my client that has 10 separate field groups named Testimonial 1, Testimonial 2, etc. Each testimonial group has the following fields: name, location, testimonial, blurb.

    Now, when the client is editing the homepage, I would like to include a select field named homepage_testimonial where he can select from a a list of the 10 testimonial field groups. On the page template, I would like to have something that follows this sort of logic:

    
    $homepage_testimonial = get_field_group( 'homepage_testimonial', 123 );
    $blurb = $homepage-testimonial-> get_field( 'blurb' );
    $name = $homepage-testimonial-> get_field( 'name' );
    $location = $homepage-testimonial-> get_field( 'location' );
    
    echo $blurb $name $location;
    

    I know the above code won’t work, but it gives an idea of what I am trying to do. I was hoping that it wouldn’t require any custom functions…

    Thanks

  • Sorry, it looks like everything will be easier if I just create a custom post-type for the testimonials with each post having its own custom fields. I didn’t know how to delete the comment. Just for curiosity’s sake if someone wanted to post a solution that would be great. Sorry again.

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

The topic ‘Can you insert a field group as a select field?’ is closed to new replies.