Twig custom text field not displaying – syntax wrong?

Is anyone here familiar with Twig? The WordPress theme Realia is supposed to display a custom text field when the price field is left empty. But it doesn’t. Here is the code that I think is responsible.

<div class="property span9">
    <div class="row">
        <div class="image span3">
            <div class="content">
                <a href="{{ wp.get_permalink(property.ID) }}"></a>
                {% if wp.get_the_post_thumbnail(property.ID) %}
                    <img src="{{ wp.aq_resize(wp.wp_get_attachment_url(wp.get_post_thumbnail_id(property.ID), 'full'), 270, 200, 'true') }}" alt="{{ property.post_title }}">
                {% else %}
                    <img src="{{ wp.get_template_directory_uri() }}/assets/img/property-tmp-small.png" alt="{{ property.post_title }}">
                {% endif %}
            </div>
            <!-- /.content -->
        </div>
        <!-- /.image -->

        <div class="body span6">
            <div class="title-price row">
                <div class="title span4">
                    <h2><a href="{{ wp.get_permalink(property.ID) }}">{{ property.post_title }}</a></h2>
                </div>
                <!-- /.title -->

                <div class="price">
                    {% if wp.get_post_meta(post.ID, '_property_custom_text').0 %}
                        {{ wp.get_post_meta(post.ID, '_property_custom_text').0 }}
                    {% else %}

                    {{ wp.aviators_price_format(property.meta._property_price.0) }}{% if property.meta._property_price_suffix.0 %}
                        <span class="suffix">{{ property.meta._property_price_suffix.0 }}</span>{% endif %}</div>

                    {% endif %}
                <!-- /.price -->
            </div>
            <!-- /.title -->

            <div class="location">{{ property.location.0.name }}</div>
            <!-- /.location -->

            <div class="body">
                {{ wp.aviators_core_get_post_teaser(property.ID) }}
            </div>
            <!-- /.body -->

            <div class="info clearfix">
                {% if property.meta._property_area.0 %}
                    <div class="area">
                        <span class="key">{{ wp.__('Area', 'aviators') }}:</span><!-- /.key -->
                        <span class="value">{{ property.meta._property_area.0 }}{{ wp.aviators_settings_get_value('properties', 'units', 'area')|raw }}</span><!-- /.value -->
                    </div><!-- /.area -->
                {% endif %}

                {% if property.meta._property_bedrooms.0 %}
                    <div class="bedrooms" title="{{ wp.__('Bedrooms', 'aviators') }}">
                        <div class="content">{{ property.meta._property_bedrooms.0 }}</div>
                    </div><!-- /.bedrooms -->
                {% endif %}

                {% if property.meta._property_bathrooms.0 %}
                    <div class="bathrooms" title="{{ wp.__('Bathrooms', 'aviators') }}">
                        <div class="content">{{ property.meta._property_bathrooms.0 }}</div>
                    </div><!-- /.bathrooms -->
                {% endif %}
            </div>
            <!-- /.info -->
        </div>
        <!-- /.body -->
    </div>
    <!-- /.row -->
</div><!-- /.property -->

Related posts

Leave a Reply

1 comment