Doesn't display list when I set this to the field multiple

Support MB Views Doesn't display list when I set this to the field multiple

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39063
    JamesJames
    Participant
    {% 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;
    }
    #39065
    JamesJames
    Participant

    The meta field adder doesn't show the for loop. It's good now. Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.