Bigger thumbnail for featured image of related post id

Support MB Views Bigger thumbnail for featured image of related post idResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39479
    EddyPiVEddyPiV
    Participant

    Hi,

    I am displaying all posts of a cpt of the current author. One field is the related_product_id.
    I am showing the thumbnail of that related_product_id.
    It's working, but I would like to show a bigger size, actually like the post.thumbnail.medium definitions.

    This is the code:

    {% set user_ID = mb.get_current_user_id()  %}
    {% set args = {  post_type: 'mybundle', post_status: 'private', posts_per_page: -1, author: user_ID } %}
    
    <div class="sub_container">
    {% set posts = mb.get_posts( args ) %}
    {% for post in posts %}
    	<div class="sub_item">
    		{% set post_link = mb.get_permalink( post.ID )  %}
    		<a href="{{ post_link }}">{{ mb.get_the_post_thumbnail( post.related_product_id, 'thumbnail' ) }} </a>	
    		<h3><a href="{{ post_link }}">{{ post.post_title }} </a> </h3>	
    	</div>
    {% endfor %}   
    </div>

    How to get the thumbnail bigger??

    #39490
    PeterPeter
    Moderator

    Hello Eddy,

    You are using the function get_the_post_thumbnail() to get the post thumbnail, so please read more on WordPress documentation to know how to get other thumbnails https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/

    {{ mb.get_the_post_thumbnail( post.related_product_id, 'large' ) }}

    #39495
    EddyPiVEddyPiV
    Participant

    Hi Peter, thanks a lot, that was helpful.

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