- This topic has 6 replies, 2 voices, and was last updated 5 years, 6 months ago by leonloberman.
-
AuthorPosts
-
October 7, 2018 at 6:33 am #156048leonlobermanParticipant
Currently, it defaults to use a 533 x 533px image in the Featured Content block – can this be changed to something else – for example, 533 x 333px? I prefer this sort of ratio.
If I load media when another theme is in place, then only the following image sizes are created:
Original
1024×683
150×150
300×200
768×350
768×512Fotografie creates the following:
1024×640
1148×574
150×150
300×188
50×50
533×533
640×640
768×480
864×800Thanks
Leon
October 8, 2018 at 1:15 am #156139MaheshKeymaster@leonloberman: For this you’ll need to create a child theme. You can use Generate Child Theme plugin to create the child theme. Then add the following code into
functions.php
add_image_size( 'fotografie-featured-custom', 533, 333, true );
And create a file named
components\features\featured-content\content-featured.php
and add the code from the following url.
https://bit.ly/2zXPKkVIf you have any issue, let me know.
Regards,
MaheshOctober 8, 2018 at 1:41 pm #156195leonlobermanParticipantHi Mahesh
Thanks – I can see that upon loading the media it creates a 533x333px thumbnail but it still seems to select the 533x533px.
Should the content-featured.php file go in the child theme directory?
Leon
October 8, 2018 at 3:09 pm #156209leonlobermanParticipantActually – it is selecting a 640x640px thumbnail …
October 8, 2018 at 3:24 pm #156212leonlobermanParticipantOk – resolved it (sort of).
1) My mistake – I hadn’t built out the full directory structure for the content-featured.php file
2) I have my site layout set to Fluid – so it wasn’t using the new thumbnail size anyway. If I change these lines:if ( ‘fluid’ === get_theme_mod( ‘fotografie_layout_type’ ) ) {
$thumbnail = ‘fotografie-featured-fluid’;
}to
if ( ‘fluid’ === get_theme_mod( ‘fotografie_layout_type’ ) ) {
$thumbnail = ‘fotografie-featured-custom’;
}then it works – however I’m not sure what the impacts of doing this are? what’s the difference between Boxed and Fluid?
Thanks
Leon
October 9, 2018 at 1:09 am #156258MaheshKeymaster@leonloberman: In the code that I’ve given, image of your desired dimension will be displayed in boxed layout. So please select boxed layout. But if you want it in both boxed and fluid, the changes you’ve made in the code as above will work.
The difference between boxed and fluid layout is, boxed layout has max-width of 1600px and the content is displayed in the middle with certain space in left and right like boxed layout. And in fluid layout, has 100% width.Hope this clarifies you.
Regards,
MaheshOctober 9, 2018 at 3:27 am #156287leonlobermanParticipantGreat – thank you.
-
AuthorPosts
- The topic ‘Can I change the image size for Featured Content’ is closed to new replies.