Hi Régis,
Thank you for reaching out.
If you use the function get_posts()
, it will return post objects, we can call it a custom query. A post object does not support to access the field ID as a property of it.
You can get the post info via the post ID in a custom query by using the WordPress functions or our helper function rwmb_meta(). For example, featured image, use the function get_the_post_thumbnail().
<div class="markets">
{% set args = {post_type: 'market', posts_per_page: -1} %}
{% set posts = mb.get_posts( args ) %}
{% for post in posts %}
{# Image #}
{% set image = mb.rwmb_meta( 'logo_market', '', post.ID ) %}
<img src="{{ image['full_url'] }} ">
{{ mb.get_the_post_thumbnail( post.ID, 'thumbnail' ) }}
{% endfor %}
</div>