Support

Account

Home Forums General Issues Custom fields inside Twig Template using Realia Theme

Helping

Custom fields inside Twig Template using Realia Theme

  • Hi, I’m Marimar , i ran into an issue some minutes ago, Trying to add more values to the Realia properties theme i needed to add my custom fields into the Twig templates since Realia Theme is most of it made with Twigs.

    So, i was searching and never found a good answer to this anywhere, so i tried a little bit more playing with the code and finally got my fields to display! yeah!

    So i came to share this with you guys, i hope this can be helpful to inexperienced people like me, and if someone have knowledge on this matter fell free to share it with us!

    So, i just figured it out with the basic php code:

    this:
    <?php the_field(‘field_name’); ?>

    Became this:

    {{ wp.get_field(‘field_name’) }}

    It’s seem that is wasn’t that hard, but well, it took me a little to realize it. Hope this works for someone in need and that everyone else can share some other codes examples here.

  • Hi !

    I’m working too with Realia template and I want to thank you for your code !
    I add an ACF field in my properties post and now I want it to be a part of the front end submission. All I did for the moment is to display the ACF field in property page and a textarea in front end submission. However I don’t know how to save the field value with the add button…
    Do you ( or someone else ) have an idea ?
    I found the button code in add.twig but it is related to aviators so I’m lost..

    Button code

    <div class="form-actions">
                {% set value = wp.__('Save', 'aviators') %}
                <input type="submit" class="btn btn-primary" value="{{ value }}">
            </div>
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Custom fields inside Twig Template using Realia Theme’ is closed to new replies.