BuddyBoss Home – Web Support Forums Solutions Social Learner How to make Sensei course images square?

Tagged: 

Viewing 15 posts - 1 through 15 (of 31 total)
  • Question

    #42505

    Anonymous
    @

    How to make Sensei course images square to fit the product images?

    i.e. 350×350 for single course page,
    and scaled smaller, but still square on the course overview pages?

    Answers

    #42512

    Anonymous
    @

    And: How to remove the red thin border around the course image in the courses overview?
    I have search for 10 minutes now and cannot find the element.

    #42534
    @rugwarrior

    Square would be nice. Thank you for the question 🙂

    #42608
    @vapvarun

    Hi @rugwarrior and @nmschaller, you can add this function is child theme fucntions.php

    
    function child_theme_setup() {
        add_image_size( 'course-archive-thumb', 360, 360, true );
    }
    add_action( 'after_setup_theme', 'child_theme_setup', 11 );
    

    after addition of function you will need to regenerate the thumbnails
    you can use https://wordpress.org/plugins/regenerate-thumbnails/ plugin to regenearte them.

    Regards
    Varun Dubey

    #42614

    Anonymous
    @

    Hello @vapvarun,

    I have installed the plugin from Viper007Bond and regenerated a thumbnail for a test.

    Works only on the course archive page generated by your BuddyBoss Sensei plugin, but not on other pages:

    – single course page
    – page “New courses” /course automatically generated by Sensei.

    Also, when I go into the media file in the media library, irritatingly, the thumbnail is still shown in the old format.

    There are so many image settings for Sensei images in the sensei settings; I really don’t know what I shall put in there to fit your theme.

    #42617

    Anonymous
    @

    Correction: Works also on the New Courses /course page, but not on the single course page

    #42676
    @vapvarun

    Hi @nmschaller, I have provided the codes for the archive only for the single one, keep the width same else we will also need to alter the css

    update with old code with following and regenerate them once more

    
    function child_theme_setup() {
        add_image_size( 'course-archive-thumb', 360, 360, true );
        add_image_size( 'course-single-thumb', 472, 472, true );
    }
    add_action( 'after_setup_theme', 'child_theme_setup', 11 );
    

    Regards
    Varun Dubey

    #42677

    Anonymous
    @

    Do I need to take 472x472px? I have now created all product images in 450x450px and want to reuse them for course pictures – that is the point in making them square.

    #42678
    @vapvarun

    you can try with 450*450, might be it need some minnor adjustment

    Regards

    #42680

    Anonymous
    @

    @vapvarun

    It does not work. I have tried it with 450, 450 and with the original code above.

    All thumbnails are back to original ratio. No square.

    Is the code correct? Can I separate it in two? What does the 11 mean?

    #42681
    @vapvarun

    Hi @nmschaller, 11 is the priority as those are already defined in plugin codes thus i am overriding them with higher priority.

    Save them and then regenerate thumbnails
    Regards

    #42683

    Anonymous
    @


    @vapvarun

    How annoying! Now everything is back to how it was before (non-square).

    While the code from yesterday for the course archive was working in the custom functions.php, now it is not working anymore. Nor is the code from today. I have also changed the Sensei settings to make the single course image size fit your code. No change.

    What shall I do?

    #42684
    @vapvarun

    Hi @nmschaller, i will pass this to developers. I will post their response.
    Regards

    #42687

    Anonymous
    @

    Please provide code for original file size = max. single course image size of 450×450 px. Thank you.

    #42688

    Anonymous
    @

    @vapvarun

    What I am wondering:

    There are settings in Sensei settings to create course archive images and single course images in a certain thumbnail size – with our without hard cropping.

    I am now using without hard cropping for both product and course images.

    And from my attempts to change the image display via CSS, my understanding that this is rather a matter of the image mask on the course archive and single course page.

    So why add further images sizes via functions.php at all?

    And while it may make sense to define the original file size of 450x450px as another thumbnail size, I wonder why it is “added” as an image size as it already exists.

    I just hope that the wordpress database is cleared of previous thumbnails. Not that the images are piling up in my database every time I regenerate thumbnails.

Viewing 15 posts - 1 through 15 (of 31 total)
  • The question ‘How to make Sensei course images square?’ is closed to new replies.