Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1388070

    I am moving a website that uses sensei to Enfold. Everything is going ok but I just faced a problem.

    When you add a course, you just select a featured image and when you see that course page, you see the complete image, nothing fancy.

    The old site shows the image correctly using a 400×400 jpg. (original 600×600)
    Enfold shows a cropped image using a 600×423 jpg. (original 600×600)

    The problem is that the image is not decorative. It has text: Course A with Module B and 5 lessons.

    So it is cropped and the text at the top and bottom of the image is all cut.

    How can I fix this?

    Thank you.

    #1393843

    Hi peterolle,

    Please try to add this PHP code at the bottom of your child theme’s functions.php code:

    function enfold_customization_modify_thumb_size( $size ) {
      $size['entry_without_sidebar'] = array('width'=>1210, 'height'=>600);
      return $size;
    }
    
    add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );

    Then use an image regeneration plugin to regenerate images or manually re-upload the featured images.
    Let us know if this helps.

    Best regards,
    Nikko

    #1393869

    Thank you Nikko.

    Will this affect everything or just Sensei? (There are pages, blog post, etc…)
    Which plugin you recommend to regenerate images?

    • This reply was modified 1 year, 11 months ago by peterolle.
    #1394023

    Hi peterolle,

    Will this affect everything or just Sensei? (There are pages, blog post, etc…)
    Yes, it affects pages and blogposts, everything that uses entry_without_sidebar image size.

    In order for this to only affect Sensei Course page, then you will need to do the following (remove the previous code I gave):
    1. Use a child theme.
    2. In the child theme’s functions.php code add:

    $avia_config['imgSize']['course']= array('width'=>600, 'height'=>600 );

    3. Add a new file and name it single-course.php then paste this code https://pastebin.com/RxinjScd
    4. Create a new folder and call it includes
    5. Inside the includes folder, create a file called loop-course.php and paste this code https://pastebin.com/EGjciWeX

    If you need it for Lessons in Sensei, just duplicate single-course.php and rename it to single-lesson.php

    Which plugin you recommend to regenerate images?
    I use this one: https://wordpress.org/plugins/simple-image-sizes/ since you can choose which image sizes you can regenerate, but if you are following the 5 steps I mentioned then it is not necessary.

    Best regards,
    Nikko

    #1394688

    Thank you Nikko.

    I gave this a shot and the result is not as expected.

    1- The first code worked fine.

    2- The second one that applies only to sensei:

    Shows the bad cropped image again.
    After the bad cropped image it shows “latest post” with a featured huge image and then the posts that repeat.

    This was with just a simple course page with nothing in it.

    I believe I will have to stick with the first code, unless you can have a look and let me know what to fix.

    Thank you, I really appreciate your help.

    #1394969

    Hi peterolle,

    Can you setup a staging site? so I can check on it further.
    Just post the credential in private content.

    Best regards,
    Nikko

    #1396996

    Thank you Nikko, I had to finish the website and move it to live, so it went out using the first code.

    The dev site was deleted, so I can’t give you access there.

    You can close this post, unless you want to create a site with sensei and test to update with results. If by my end another client comes with sensei, I’ll ask again.

    #1397034

    Hi,

    Thanks for the update, I’ll go ahead and close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Featured image for sensei is cropped’ is closed to new replies.