Meta Box
Support Forum
Support › MB Views › Doesn't display list when I set this to the field multiple
{% for post in query.posts %} <a href="{{ post.post_related.url }}">{{ post.post_related.title }}</a> {{ post.post_related.date | date( 'F j, Y' ) }} {{ mb.get_the_term_list( post.post_related.ID, 'category', '', ', ' ) }} {{ post.post_related.post_comments() }} <img src="{{ post.post_related.thumbnail.full.url }}" width="{{ post.post_related.thumbnail.full.width }}" height="{{ post.post_related.thumbnail.full.height }}" alt="{{ post.post_related.thumbnail.full.alt }}"> {% endfor %}
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Related Post', 'your-text-domain' ), 'id' => 'related-post', 'fields' => [ [ 'name' => __( 'Post', 'your-text-domain' ), 'id' => $prefix . 'post_related', 'type' => 'post', 'post_type' => ['post'], 'field_type' => 'select_advanced', 'multiple' => true, ], ], ]; return $meta_boxes; }
The meta field adder doesn't show the for loop. It's good now. Thanks