Home Forums General Issues Using 2 different field groups on one custom post type


Using 2 different field groups on one custom post type

  • Hi, I’m in need of a little help with Advanced Custom Fields and Custom Post Types.

    I have created 2 sets of Field Groups for 2 different clients that are restaurants with different menu types.

    I have 1 new custom post type called ‘Menus’. Then I have created Menu categories for each client. I have then assigned, client specific, custom fields to show on each menu category custom post type.

    This all works fine for one of the restaurants but not for the other even though they have all been set up in the same way, albeit, using different unique field names.

    Can someone please let me know if it is possible to have more than one set of field groups to display individually on 1 custom post type depending on which client (restaurant) it is?

    Many thanks in advance.

  • It’s hard for me to imagine what your setup looks like.

    So, you have a custom post type with taxonomy (categories) and you want to show different fields depending on which category is selected? What exactly does “doesn’t work for the other” mean? Are the same fields shown as for the first restaurant? Is nothing coming up at all? I guess a couple of screenshots would help, or a clear explanation of each field group setting.

  • Hi vipstephan, thanks for getting back to me.

    Yes sorry let me explain myself a lot clearer.

    I have created 2 seperate field groups for 2 different restaurants as their menus have different types of items on them. I have attached screen shots to hopefully show what I mean.

    The CJ Menu Field Group, (cj-menu-field-group.png – screenshot attached) shows the correct corresponding custom fields on the custom post type depending on which menu it needs to display. There are 4 different menu types for CJ created as taxonomies. When I open each custom post type associated with each one of the different Menu types taxonomies, the correct custom fields display.

    So the A La Carte custom post type (a-la-carte-cpt.png – screenshot attached) shows the A La Carte custom fields as it should do.

    However the FI Menu Field Group (fi-menu-field-group.png – screenshot attached) shows the Beers and Soft Drinks custom fields on the Champagne and Prosecco custom post type (beers-soft-drinks-cpt.png – screenshot attached).

    As I have Menu taxonomies created for ‘Restaurants’, I was hoping that I could just filter them to the correct restaurants custom fields this way.

    I hope this makes sense and look forward to any help that you can offer.

  • Just to let you know that I have found out what was causing the error and it was something as simple as I had no content inserted into the custom post types which is why it was not displaying the associated custo fields!

    Feeling a little bit silly now!

  • It’s difficult for me to envision how your arrangement appears.

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

You must be logged in to reply to this topic.