Home › Forums › General Issues › Register two locations via php doesn\'t work › Reply To: Register two locations via php doesn\'t work
The nesting on your location array is not right
'location' => array(
// each OR group is an array
array(
// each location in the group is an array
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
// if you wanted to add an "AND' rule it would go here
),
// this is another OR group
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'aran_agencies',
),
),
),
);
Also, menu order and position are not part of the location, these cannot be set differently for different locations.
The best way to figure out how to construct parts of a field group is to create one with the features you want and then export it to code, then use that as an example.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.