Okay
  Public Ticket #217519
Recent posts short code thumbnail size
Closed

Comments

  • Bjorn started the conversation

    Hi,

    I'm using the "recent-posts" short code on my frontpage, in a visual composer row.

    Now the size of the thumbnail has changed to the landscape version and the image is cropped. Previously when the featured image was portrait, it would also display as portrait via the shortcode.

    How can I change this and where ?

    Thanks !

  •  8,940
    Tahir replied

    Hey Bjorn!

    All the shortcode logic is inside "salient\nectar\tinymce\shortcode-processing.php"  . By previously do you mean previous theme version ? . 

    Thanks


    ThemeNectar Support Team 

  • Bjorn replied

    I'm not sure when the problem arose actually, I think it was after I updated to the previous release 4.0.3.

    Is there a way to have the recent posts thumbnails being used, respecting the orientation and aspect of the image ?

  •  1,086
    ThemeNectar replied

    Hey Bjorn!

    Open the shortcode-processing.php file located in the nectar/tinymce directory and change this line:

     
    if ( has_post_thumbnail() ) { echo '' . get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => '')) . ''; }
    
    to
     
    if ( has_post_thumbnail() ) { echo '' . get_the_post_thumbnail($post->ID, 'full', array('title' => '')) . ''; }
    
    It should be located near line 1849

    Cheers :)

  • Bjorn replied

    Hi,

    Perfect this works for me..

    What is the correct way to implement this when working with a child theme. Just copying the file to my theme folder doesn't work.

    I guess that with the next update this mod will not work anymore ?

    Thanks for your exceptional support :)

  •  8,940
    Tahir replied

    Hey Bjorn!

    You will have to copy paste the whole recent post function into the child theme functions.php so the modified function is called first. 

    Thanks


    ThemeNectar Support Team