How can we help?

If you are looking for support for our Poka theme, this is the place!

Home Forums Poka v2 support Custom Fields

This topic contains 10 replies, has 2 voices, and was last updated by  admin 6 months, 4 weeks ago.

Viewing 10 posts - 1 through 10 (of 11 total)
  • Author
    Posts
  • #1543

    Christopher Witte
    Participant

    Hi!

    I have added a few custom fields into the theme.

    When i add numbers into these fields some of them just disapears when i publish/updates the page.

    What am i doing wrong?

    Best
    Chris

    #1544

    Christopher Witte
    Participant

    Custom Fields

    #1545

    admin
    Keymaster

    Hi Christopher,

    What is the procedure you followed in adding these new fields?
    Have you added these new fields inside acf-metaboxes.php ?
    If this is the case then it is very crucial that the IDs of these new fields to be unique.
    For example “field_562a457b33100”.
    You can generate unique strings with PHP function uniqid();

    #1547

    Christopher Witte
    Participant

    Hi,

    I have added all of the 3 fields the same way – and the only number that stays in the review after i update is “Omsättningskrav”

    Here are my custom fields – i have used unique IDs for all of them:

    array (
    ‘key’ => ‘field_795cd78dabd4k’,
    ‘label’ => ‘Bonusbelopp (Bonusfiltreraren)’,
    ‘name’ => ‘Bonusbelopp’,
    ‘type’ => ‘number’,
    ‘instructions’ => ”,
    ‘required’ => 0,
    ‘conditional_logic’ => 0,
    ‘wrapper’ => array (
    ‘width’ => ”,
    ‘class’ => ”,
    ‘id’ => ”,
    ),
    ‘default_value’ => ”,
    ‘placeholder’ => ”,
    ‘prepend’ => ”,
    ‘append’ => ”,
    ‘maxlength’ => ”,
    ‘readonly’ => 0,
    ‘disabled’ => 0,
    ),
    array (
    ‘key’ => ‘field_595cd78dabd5k’,
    ‘label’ => ‘Omsättningskrav (Bonusfiltreraren)’,
    ‘name’ => ‘Omsättningskrav’,
    ‘type’ => ‘number’,
    ‘instructions’ => ”,
    ‘required’ => 0,
    ‘conditional_logic’ => 0,
    ‘wrapper’ => array (
    ‘width’ => ”,
    ‘class’ => ”,
    ‘id’ => ”,
    ),
    ‘default_value’ => ”,
    ‘placeholder’ => ”,
    ‘prepend’ => ”,
    ‘append’ => ”,
    ‘maxlength’ => ”,
    ‘readonly’ => 0,
    ‘disabled’ => 0,
    ),
    array (
    ‘key’ => ‘field_698cd78eabd4o’,
    ‘label’ => ‘Minodds (Bonusfiltreraren)’,
    ‘name’ => ‘Minodds’,
    ‘type’ => ‘number’,
    ‘instructions’ => ”,
    ‘required’ => 0,
    ‘conditional_logic’ => 0,
    ‘wrapper’ => array (
    ‘width’ => ”,
    ‘class’ => ”,
    ‘id’ => ”,
    ),
    ‘default_value’ => ”,
    ‘placeholder’ => ”,
    ‘prepend’ => ”,
    ‘append’ => ”,
    ‘maxlength’ => ”,
    ‘readonly’ => 0,
    ‘disabled’ => 0,
    ),

    #1548

    admin
    Keymaster

    In the name it’s best if you keep it as simple as you can, remove the special characters, for example : Omsättningskrav -> omsattningskrav
    Also change in all three fields from ‘type’ => ‘number’ to ‘type’ => ‘text’
    Lastly the keys are created with uniqid() ? Because it is very important for these fields to be unique.

    #1549

    Christopher Witte
    Participant

    Thanks!

    I hade just changed the ID of another key slightly – where do i run the PHP function to get a unique ID?

    Is there somewhere else i need to create these variables to make them “saveable”? I think its wierd that they show up in the wordpress admin but that im not able to store any numbers in them

    //Chris

    #1551

    admin
    Keymaster

    Hi Chris,

    You can try an online parser like http://www.writephponline.com/ and you can run the uniqid();
    The main issues for not saving the data in custom fields are the IDs to be unique and the names to be valid.

    #1582

    Christopher Witte
    Participant
    This reply has been marked as private.
    #1596

    admin
    Keymaster

    Hi,

    I believe that the problem is misconfiguration in metaboxes array.
    Just to be sure you can try to enable ACF options panel with:

    add_filter('acf/settings/show_admin', '__return_true', 100);

    and try creating your fields with the Visual tool of ACF, if you still experience the same problems then indeed is something with the server configuration, if everything is saved correctly then you are doing something wrong in acf-metaboxes.php

    #1601

    Christopher Witte
    Participant

    Hi,

    Thank you for the reply,

    Where do i add that line of code?

    // Chris

Viewing 10 posts - 1 through 10 (of 11 total)

You must be logged in to reply to this topic.