Support

Account

Home Forums General Issues How to Upgrade Simple Fields to ACF 5 Reply To: How to Upgrade Simple Fields to ACF 5

  • Hi John & John,

    Thank you for your last posts (I forgot to check the Notify box and only saw your replies this week…)
    I will transfer the contents of the SF-fields manually into ACF-fields.

    1) I have created a new ACF-group field, with the same fields and names as the SF-group field
    You can see 3 of the fields on the left side of the page https://www.blinireizen.nl/reizen/georgie-compleet/. Georgia Complete is one of the 84 example-programs we offer, the template for every example tour is the same. The fields REISSCHEMA (fieldname=reisschema), REVIEWS & REiSVERSLAGEN (fieldname=reactie), BLINI TIP (fieldname=tip) and SOCIAL MEDIA (fieldname=FB_photo).

    2) I have filled one ACF-group field manually, with the same contents as the corresponding SF-group.

    3) I have located the theme and all php-files where the SF-function is used (fortunately not that many).

    4) I have started adjusting the most important php-file (in which the left bar of the mentioned page is filled). BUt unfortunately I got stuck here. The current code says:

    <?php
    $meta_schema = simple_fields_get_post_value($post->ID, “reisschema”, true);
    $tip = simple_fields_get_post_value($post->ID, “tip”, true);
    $reactie = simple_fields_get_post_value($post->ID, “reactie”, true);
    $FB_photo = simple_fields_value(“FB_photo”);
    $FB_photo = apply_filters(“the_content”, $FB_photo);
    ?>

    I started with only 1 field and replaced the second line with:
    $tip = get_field($post->ID, “tip”, true);
    if( $value ) {
    echo $value;
    } else {
    echo ’empty’;
    }

    When testing, it says ’empty’. Probably I can’t use the parameter $post->ID in the same way as is done in the SF-function, but I can’t find in the ADCF-documentation how it should be done.

    Two questions:
    * can you tell me how to fill this parameter (I assume this refers to the number of the post, e.g. number 78 of our example programs.
    * If you can’t help me, could you advise me where to post this question? I think for someone who knows php this won’t be very difficult to solve.

    By the way, fortunately we also have a test-environment, so nothing can go wrong when trying.

    Thanks again!