How to assign field groups to a specific post or CPT using ACPT

  • ACPT

learn how to effectively assign field groups to specific posts or CPT, using ACPT. I'll will guide you through the process of setting up location rules, ensuring that your custom fields appear precisely where you need them

In our previous tutorial on how to create a field groups using ACPT, we learned two methods of creating field groups. In this tutorial, we will explore how to assign those field groups to a specific post or CPT.

Assigning Field Group to a CPT

To assign field groups to a CPT or pages, posts, users, or taxonomy, the first step is to set the location for those field groups. This involves defining the conditions that determine where the fields will be displayed.

Web interface with options for group name, conditions, and priority. A cursor points to the "Add condition" button under the location section.

In the field groups settings, you will find an “Add Condition” button. Click on this button to add your first condition for the field group.

Screenshot of a WordPress ACPT field group page showing settings for display, context, priority, and conditions. Mouse cursor hovers over a dropdown menu with selectable options.

After clicking the “Add Condition” button, you will see three dropdown menus that will help you determine where to display the field groups.

  1. Location Dropdown: This dropdown allows you to select the type of content where the field group will appear. Options include posts, taxonomies, attachments, users, and options pages.
  2. Condition Dropdown: The second dropdown lets you specify the logic for the condition. Options include:
    • “is equal to”
    • “is not equal to”
    • “is included in”
    • “is not included in”
  3. Value Dropdown: The final dropdown is for selecting the specific post, page, or item related to the location you defined. The values available here will depend on the location you selected, as the options will vary based on the chosen content type.

By choosing your options from these dropdowns, you can customize exactly where and how your field groups will be displayed based on the specific conditions you set.

A settings page in a software interface shows dropdown menus for selecting the post type, condition, and logic. A mouse pointer hovers over a dropdown menu option.

In this tutorial, we aim to display our field groups in the Recipes Custom Post Type. To do this, we will select the location option of “Post Type.”

A computer interface showing configuration options for group settings, with a dropdown menu being selected.

We will set the condition to “is equal to,” ensuring that the field groups will only be displayed when the post type matches the value, which is the Recipe Custom Post Type.

User interface showing settings with drop-down menu for "Location" condition. Options include "Select", "Posts", "Pages", "Recipes", and "WP Templates". A cursor points to "Recipes".

Once you have assigned your field groups to a specific location, click on “Save,” and you’re all set!

After saving, you will be redirected to the field group overview page, where you can view the newly created field groups. This information includes the group name, the location of the field group, and the number of fields. We will explore the other options as we delve deeper into custom fields.

Screenshot of a website interface showing field groups. Columns include Group Name, Display As, Content, Priority, Location (set to "Show"), Field Count, and Actions options like Edit and Delete.

In our next tutorial, we will focus on creating meta boxes and fields. This will allow us to explore the functionalities of custom post types in greater depth, enhancing our ability to customize and manage our content effectively. 

ACPT Version :

LogoCreated with Sketch.

Bricks Version :

If you haven't purchased ACPT yet and are planning to, we'd appreciate it if you use our affiliate link. It costs you nothing extra and helps us continue to deliver quality content.