-
AuthorPosts
-
July 27, 2014 at 12:35 pm #296442Anonymous
Hello,
is there any way to change the image size of the magazine element hero image? The theme seems to always use the – in my view – false predefined image size so that the images are always very narrow. I’d rather like to have a square hero image on the side.
Thanks in advance!
July 29, 2014 at 4:32 pm #297331Hi alwo!
Yes you can use a filter to change the thumbnail size – insert this code into the child theme functions.php (or enfold/functions.php) file:
add_filter('avf_magazine_settings', 'avia_magazine_thumbnail', 10, 2); function avia_magazine_thumbnail($atts, $magazine){ $atts['image_size']['small'] = 'square'; return $atts; }
You can replace “square” with another thumbnail size like: ‘masonry’, featured’, ‘featured_large’, ‘portfolio’, ‘gallery’, ‘entry_with_sidebar’,’entry_without_sidebar’,extra_large’ or “magazine”
Best regards,
PeterJuly 29, 2014 at 8:01 pm #297405AnonymousHey Peter
thanks for the help! I get a syntax error un the second and third line of you code, can you check if there is something wrong with it?
Cheers
TomJuly 30, 2014 at 2:06 am #297476Hi!
I tested Dude’s code on my installation and it works fine without errors. Please post the whole functions.php with the suggested code on pastebin.com.
Best regards,
IsmaelJuly 30, 2014 at 7:48 am #297596AnonymousHello
Tried it again and it work now – yet this is only changing the size of the featured images of the other articles not the hero image. I chose the magazine element to display the first post bigger beside the others, I want this images to be squared …
Thanks!
August 4, 2014 at 5:09 pm #299766Hey!
If you want to change the size of the featured image too use this code:
add_filter('avf_magazine_settings', 'avia_magazine_thumbnail', 10, 2); function avia_magazine_thumbnail($atts, $magazine){ $atts['image_size']['small'] = 'square'; $atts['image_size']['big'] = 'entry_without_sidebar'; return $atts; }
The second size (set to “entry_without_sidebar”) will determine the size of the fearured image, the other size (set to “square”) the size of all other thumbnails.
Cheers!
PeterOctober 29, 2016 at 8:00 pm #705621Using the above codes conflicts with adding the layout builder to custom post types.
Do you have a solution for this please?
October 29, 2016 at 8:04 pm #705624Hi,
Try the following:
1. Install this plugin: https://wordpress.org/plugins/simple-image-sizes/
2. Go to Settings > Media
3. Change theentry_without_sidebar
image size (increase its width / height).
4. Regenerate the thumbnails by clicking the button at the bottom.Best regards,
YigitOctober 29, 2016 at 8:09 pm #705628Thanks Yigit for the quick reply.
Got it working!
Thanks again.
- This reply was modified 8 years ago by MIMMT.
October 29, 2016 at 9:04 pm #705654 -
AuthorPosts
- The topic ‘Change Magazine Hero Image Size’ is closed to new replies.