Home Forums Front-end Issues Newbie help pls


Newbie help pls

  • Hi guys, today my first week with WordPress and ACF.
    i am j! guy moving my setup to WordPress. so far all, ok but i need the acf to accomplish my job.

    not a coder but a self-learner.

    I hope there is some kind of ultra newbie guides.. the doc is great but newbie like me still lost with all the terms.

    i manage to play with the basic field output and that’s all works for now.

    i have 2 sets of groups with its own field.
    i wanted to hard coded , meaning call direct using field-name .sound simple but i cant accomplish that too.

    i using the basic 2016 template editing content.php just to test the code.
    basically, this is the only code that works

    <?php the_field(‘gender’); ?>

    any help appreciated. thank you.

  • Hi @sdw

    Could you please tell me what did you mean by “call direct using field-name?” Also, could you please share the code that doesn’t work?

    Please keep in mind that you need to set the code inside of The Loop. If you want to do it outside of The Loop, you need to pass the post/page ID as the second parameter to the get_field() or the_field() functions like this:

    get_field(‘custom_field_name’, 99)

    Where “99” is the post/page ID where the custom field is assigned. This page should give you more idea about it:

    Thanks 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.