I'm trying to build a view based on CPT that only pulls from a set category but the args ignore both the CPT and the category this is what I have so far:
{% set args = {post_type: 'project', posts_per_page: 10, cat: 16 } %}
<div class="sidebarnews">
{% set posts = mb.get_posts( args ) %}
<ul>
{% for post in posts %}
<li><img src="{{ post.thumbnail.medium.url }}" width="{{ post.thumbnail.medium.width }}" height="{{ post.thumbnail.medium.height }}" alt="{{ post.thumbnail.medium.alt }}">
{% for item in post.logo %}
<img src="{{ item.medium.url }}" width="{{ item.medium.width }}" height="{{ item.medium.height }}" alt="{{ item.medium.alt }}">
{% endfor %}</li>
{% endfor %}
</ul>
</div>
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().