Tagged: , ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #296442
    Anonymous

    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!

    #297331

    Hi 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,
    Peter

    #297405
    Anonymous

    Hey 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
    Tom

    #297476

    Hi!

    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,
    Ismael

    #297596
    Anonymous

    Hello

    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!

    #299766

    Hey!

    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!
    Peter

    #705621

    Using the above codes conflicts with adding the layout builder to custom post types.

    Do you have a solution for this please?

    #705624

    Hi,

    Try the following:
    1. Install this plugin: https://wordpress.org/plugins/simple-image-sizes/
    2. Go to Settings > Media
    3. Change the entry_without_sidebar image size (increase its width / height).
    4. Regenerate the thumbnails by clicking the button at the bottom.

    Best regards,
    Yigit

    #705628

    Thanks Yigit for the quick reply.

    Got it working!

    Thanks again.

    • This reply was modified 8 years ago by MIMMT.
    #705654

    Hey!

    You are welcome, let us know if you have any other questions or issues :)

    Cheers!
    Yigit

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Change Magazine Hero Image Size’ is closed to new replies.