Support Forum
Hi we are trying to build a view that has a query to products the thing is we need to include the current post ID in the meta query this is what we have but can't get it to work if we manually set the ID(producer) then it works any ideas.
<div class="rn-gallery">
{% for clone in post.gallery %}
<img src="{{ clone.image.medium.url }}" width="{{ clone.image.medium.width }}" height="{{ clone.image.medium.height }}" alt="{{ clone.image.medium.alt }}">
{% endfor %}
</div>
{% set the_post_id = mb.get_pid() %}
{% set producer = mb.get_post( the_post_id ) %}
<div class="gb-grid-wrapper gb-grid-wrapper-ca9e7987">
{% set args = { post_type: 'product', posts_per_page: 1, meta_query: [ { key: 'product_producer', value: 'producer' } ] } %}
{% set posts = mb.get_posts( args ) %}
{% for post in posts %}
{{ mb.get_the_post_thumbnail( post.ID, 'medium' ) }}
{{mb.get_the_title( post.ID )}}
{% endfor %}
</a>
</div>
Thanks Al