Okay
  Public Ticket #2127695
How to set feature image size for post slide
Closed

Comments

  • firsthatch2018 started the conversation

    Hi,

    This is Lin. I would like to ask a question about the size of feature image for post slide.

    I set the feature images for post slides. The images work well. However, I found that the feature image size for post slide varies one by one because it is sourced from original picture and the ratio is not same. 

    It seems to me that the size of feature image for post slide could be fixed if the thumbnail can be utilized as feature image. Is there any solution to set the feature image sourced from thumbnail?

    In addition, if there is any solution for this issue, please feel free to contact with me.

    Best regards,

    Lin

  • [deleted] replied

    Hello Lin,

    Thank you for getting in touch with us. My name is Attila and I'm happy to assist you today. I appreciate your patience while we've been working towards your ticket.

    You can change a layer's sizes in its Styles tab with the Width and Height fields. It is no different for dynamic layers either. You can use these option to modify the original size of the image. You can also use percentages instead of pixels, so they will keep their relative size and ratio.

  • firsthatch2018 replied

    Hi Attila,

    Thank you for your reply. I tried this method before. However, this could not solve my problem. If the original size is different, it can not be adjust into the same size by changing ratio.

    For example, there are 2 posts with different feature images, A and B.

    A is 1200*800 px. B is 1200*600 px.

    I would like to display these 2 posts in the post slides. However, it is impossible to adjust the ratio in style because the picture may be out of ratio. In addition, the setting in style may not be able to apply to the next updated posts.

    As a result, I think that I could set a thumbnail to make sure all images for post slide are in the same size and ratio. Then, I use thumbnail as the feature image for post slides. Finally, the image in post slides will be in same size.

  • [deleted] replied

    Thank you for the feedback. I'll contact with the dev team to see if this is possible to achieve somehow, and get back to you shortly.

  • firsthatch2018 replied

    Thank you for the reply.

    I am thinking whether it is possible to revise the code in LayerSlider/classes/class.ls.posts.php as below.

    $ret[$key]['thumbnail'] = !empty($ret[$key]['thumbnail']) ? $ret[$key]['thumbnail'] : LS_ROOT_URL . '/static/admin/img/blank.gif';
    $ret[$key]['image'] = '<img src="'.$ret[$key]['thumbnail'].'" alt="">';

    Hope to get positive response from your dev team.

    Have a great day.

  • [deleted] replied

    Thank you for the feedback. We went ahead and created a modified plugin version for you. It contains two new post placeholders: [thumbnail] and [thumbnail-url]

    These are just temporal solutions for your query, they will be worked out better for the next update, but until then, you can use them.

  •   [deleted] replied privately
  •   firsthatch2018 replied privately
  • [deleted] replied

    Yes, that is right.

  • firsthatch2018 replied

    Hi Attila,

    Thank you for the reply and support.

    It is very useful. I have already installed it successfully. 

    In addition, it seems that the thumbnail is indicated to default thumbnail. That is too small. As a result, I revised a little code to indicate to another thumbnail which created by the other code.

    Finally, it works very well.

    Best regards,

    Lin

  • [deleted] replied

    Thank you for the feedback.

    We will also work on it before it gets to the next update.

  • [deleted] replied

    We did some further digging and the problem is that WordPress  makes square images in 150x150 resolution by default. For the rest, the aspect ratio will dynamically change, which is the source of the problem for you. But you can change the default thumbnail size under WP -> Settings -> Media tab.

    We've also implemented a new option to allow post images to be used as layer backgrounds. Those will use the full sized image and can be controlled (resizing,cropping,etc) with the background settings (background size,background position). 

    We can also send you this, if you would like to.

  • firsthatch2018 replied

    Hi Attila,

    That sounds great. Please send it to me. I will test it on my site.

    Best regards,

    Lin

  •   [deleted] replied privately
  • firsthatch2018 replied

    Thank you.

    I will try it.