Hi,
To pass the current post ID to the variable args
, you can use your variable the_post_id
or use the current object post.ID
. And you should use another name for custom post object to separate with the current post object. For example
{% set args = { post_type: 'product', posts_per_page: 1, meta_query: [ { key: 'product_producer', value: the_post_id } ] } %}
{% set args = { post_type: 'product', posts_per_page: 1, meta_query: [ { key: 'product_producer', value: post.ID} ] } %}
{% set my_posts = mb.get_posts( args ) %}
{% for my_post in my_posts %}