Frontpage Forums Magaziner Thumbnail Crop

  • Thumbnail Crop


    Phil Boyd
    Participant

    I ran regenerate thumbnails on a couple of the featured images on my site and the crop of the image is now the Middle Center of the image. How do I get it to crop the Middle Top of the image?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #1434

    Hm, perhaps there are plugins that does this – I’ve never tried it myself, but give it a shot:

    If that doesn’t work, try this:
    https://havecamerawilltravel.com/photographer/wordpress-thumbnail-crop/

    Under where it says “Top Center”, they give this example code:

    
    add_image_size( 'wordpress-thumbnail', 200, 200, array( 'center', 'top' ) );
    

    So, the image sizes to edit would be in functions.php on line 76-78 (for Magaziner 3.0), there it says:

    
    // Thumbnail sizes
    add_image_size( 'magaziner-small', 160, 160, true );
    add_image_size( 'magaziner-medium', 520, 292, true );
    add_image_size( 'magaziner-large', 1000, 562, true );
    

    Modify it as you wish and then regenerate thumbnails.

    #1435
    Phil Boyd
    Participant

    ok, I was thinking of something more along the lines of editing CSS but maybe what you are suggesting would work better. I’ll give it a try.
    Thanks!

    #1436
    Phil Boyd
    Participant

    Alright, just now getting to implementing this.

    What thumbnail size does the featured posts use?
    It it magaziner-medium size?

    #1437

    Yeah, should be medium.

    #1438
    Phil Boyd
    Participant

    Ok Alex, I’m trying out editing the thumbnail sizes in the functions.php file. Here is what I have:

    
    // Thumbnail sizes
    		add_image_size( 'magaziner-small', 160, 160, true );
    		add_image_size( 'magaziner-medium', 520, 292, array( 'center', 'top' )  );
    		add_image_size( 'magaziner-large', 1000, 562, true  );
    		
    		// Thumbnail sizes custom widgets
    		add_image_size( 'alx-small', 160, 160, true );
    		add_image_size( 'alx-medium', 520, 292, true );
    

    It’s not working.
    You can look at https://www.nosaintshistory.com to see what I mean.

    #1446

    You need to copy the entire function from functions.php, so it would start/end with:

    
    function magazinertwo_setup() {
    
    >>Copy over the entire function here and then make the change to magaziner-medium.<<
    
    }
    

    If you are doing it with a child theme.

    If you are editing the parent theme directly, that code above there looks correct.

    #1447
    Phil Boyd
    Participant

    So the Child Theme functions.php is just an edited copy of the Parent’s function.php?

    But it still isn’t working.

    #1450

    Exactly, the whole function needs to be in there with the minor changes you make, as the theme will use that function instead of the parent theme function.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Once you purchase a product from alx.media, you will receive an account and access to the support forums.

Lost Password?