WordPress.org

Ready to get started?Download WordPress

Forums

Pinterest Pinboard Widget
[resolved] Crop images when not square (5 posts)

  1. lindseybugbee
    Member
    Posted 1 year ago #

    This is a great plugin! I really like how it looks in my sidebar, it's very eye-catching.

    My only comment would be that when the pin image is not square, then the plugin resizes the image instead of cropping it, which makes it look bad in the widget. Does anyone have any suggestions on how to resize and crop the images?

    http://wordpress.org/extend/plugins/pinterest-pinboard-widget/

  2. lindseybugbee
    Member
    Posted 1 year ago #

    Cropping the images by CSS won't work, because we don't want to crop all images. We want to crop the ones with a weird aspect ratio and unfortunately CSS does not have this information.

    I modified the php file to discard any image with a weird aspect ratio and just keep looping until my desired number of pins is found. I tested this in my computer's localhost and it worked, all the images displayed are nearly square. I haven't deployed this in my real website though because I think this is a slow solution.

    I'm hoping somebody else comes up with a better solution.

  3. walterwalker
    Member
    Posted 1 year ago #

    Lindsay,

    I manage a customize WordPress blog at http://news.everynation.org.

    The site is designed with a feature post at the top and seven posts arrayed below. When we post an article we always insert a 3:2 aspect ratio image and designate as the feature image (300 px wide and 200 px high).

    The site is custom programmed to display those 3:2 images as square image in the lower categories (the seven categories displayed on the lower part of the page).

    This has worked with exception for several years — but no longer. If you visit the site, you will notice that article posted under the category World Mission entitled "New Testament Partnership" retains the 3:2 aspect ratio and is not converted to a square as all the others.

    The conversion to square image has always work until recently. In fact, it seem to have work until WordPress recently change the process of inserting image. That being said, it does not fail to work consistently.

    My questions:

    1) Why do these images (the one in the World Mission category and the one in the Solo Scriptura category) not auto square as before?

    2) Is this ultimately a WordPress issue, a picture formatting issue, or a programming issue.

    Thank you for your help.

    Walt

  4. walterwalker
    Member
    Posted 1 year ago #

    Correction on previous post:

    "This has worked with exception for several years" should read "without exception."

    Walt Walker

  5. lindseybugbee
    Member
    Posted 1 year ago #

    Hi Walter,

    I'm not sure what your issue is. My best guess is that it is an issue with your code. I would check the PHP section of the code where you get the featured images. I would start by looking in your code for:

    <article class="secondary-article">

    and see what's going on there.

    This question, however, actually is not related to the Pinterest plugin. I am no longer using the plugin either, so I am going to close this thread.

    Good luck!

    Lindsey

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.