May 23, 2017 at 7:02 pm #8255
I just discovered Piklist and it is really great and basically the thing I was searching for – giving me the features of plugins like ACF but still the flexibility of PHP code.
Let’s hope Piklist will be further developed and maintained for a long, long time. 🙂
I want a repeating/loop/”add more” field with items that each have a post-relate field.
I tried the following code (how sleek and beautiful Piklist code is!)
/* Title: Test Post Type: parent-post */ piklist('field', array( 'type' => 'group' ,'field' => 'items' ,'label' => 'Items' ,'add_more' => true ,'fields' => array( array( 'type' => 'text' ,'field' => 'field-1' ,'label' => 'Field 1' ,'value' => '' ) ,array( 'type' => 'post-relate' ,'scope' => 'post' ,'template' => 'field' ) ) ));
While the normal text field is in each “add more” item, the post-relate field is shown only once below all the “add more” items.
What could be wrong with the code above – how can I have a post-relate field per “add more” item?
I also attached a screenshot.
Thanks in advance and
with best regards
Attachments:You must be logged in to view attached files.
You must be logged in to reply to this topic.