acf-builder icon indicating copy to clipboard operation
acf-builder copied to clipboard

Location front_page with multiple - translated - front pages

Open mouuuton opened this issue 5 years ago • 0 comments

Hi all,

I'm trying to display some custom fields on multiple front pages (different languages, using Polylang). I managed to do it with the front page set in Settings > Reading > Static page > my page but it's not working with the other - translated - front pages.

Here is my code:

$team = new FieldsBuilder('team', [
    'key' => 'team', 
    'style' => 'seamless'
]);
$team
    ->addImage('photo')
    ->addText('role')
    ->setLocation('page_type, '==', 'front_page');

add_action('acf/init', function() use ($team) {
   acf_add_local_field_group($team->build());
});

Any solution?

mouuuton avatar Feb 07 '20 09:02 mouuuton