BuddyBoss Home – Web › Support Forums › Solutions › Social Learner › How to make Sensei course images square?
Tagged: Sensei images
- This topic has 30 replies, 3 contibutors, and was last updated 9 years, 4 months ago by Anonymous.
Question
July 11, 2015 at 4:53 pm #42505@
AnonymousHow 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
July 12, 2015 at 12:46 am #42512@
AnonymousAnd: 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.July 12, 2015 at 10:57 am #42534@rugwarriorSquare would be nice. Thank you for the question 🙂
July 14, 2015 at 6:49 am #42608@
AnonymousHi @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 DubeyJuly 14, 2015 at 8:52 am #42614@
AnonymousHello @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.
July 14, 2015 at 9:02 am #42617@
AnonymousCorrection: Works also on the New Courses /course page, but not on the single course page
July 15, 2015 at 12:29 am #42676@
AnonymousHi @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 DubeyJuly 15, 2015 at 12:32 am #42677@
AnonymousDo 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.
July 15, 2015 at 12:41 am #42678@
Anonymousyou can try with 450*450, might be it need some minnor adjustment
Regards
July 15, 2015 at 12:44 am #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?
July 15, 2015 at 12:49 am #42681@
AnonymousHi @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
RegardsJuly 15, 2015 at 12:53 am #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?
July 15, 2015 at 12:56 am #42684@
AnonymousHi @nmschaller, i will pass this to developers. I will post their response.
RegardsJuly 15, 2015 at 1:31 am #42687@
AnonymousPlease provide code for original file size = max. single course image size of 450×450 px. Thank you.
July 15, 2015 at 1:39 am #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.
- The question ‘How to make Sensei course images square?’ is closed to new replies.