Support

Account

Home Forums General Issues acf_add_local_field_group for multiple page templates

Solving

acf_add_local_field_group for multiple page templates

  • I’m using the acf_add_local_field_group function to add fields to a page template. I have the following code in my functions.php file:

     include_once('includes/playoffs_fields_base.php');
     include_once('includes/playoffs_fields_soft.php');
     include_once('includes/playoffs_fields_blax.php');
     include_once('includes/playoffs_fields_glax.php');
     include_once('includes/playoffs_fields_bten.php');
     include_once('includes/playoffs_fields_gten.php');
    

    Each file changes a parameter of a certain field to correspond to a specific taxonomy when a page template is selected. They all work individually if I comment out the other five, but I can’t get them to work together.

  • What are you doing in these files? Are you completely defining the same field group multiple times? I the answer is yes, that will only work if each field group has a different group key and different location rules.

  • I thought that’s what might be happening. Thanks for responding.

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

The topic ‘acf_add_local_field_group for multiple page templates’ is closed to new replies.