• Resolved cristofayre

    (@cristofayre)


    The plugin uses the ID of the graphic in the media library. But I have found that as of May 2021, the number is NOT shown if you click on “View” More correctly, it is not given an ID number UNTIL it is linked to a page. (On my WP, if the graphic is simply uploaded to the media library, it is given an “append” link so that you can associate it with a post. Once attached to SOMETHING, hovering over the link over the graphic shows the upload.php and associated number. Or am I doing something wrong?)

    Would it be possible to use the filename rather than the ID, (although appreciate the ID may be a means of locating the value within mySQL whereas the filename might be ‘hidden’ within a row along with all the other attributes)

    Also, the upload only allows a square image, and will crop a 16:9 image. Could graphic size be optional? Or is that set by WP (I’ve also got the added complication that my theme uses FIVE custom sizes, 2x 1.42 aspect ratio,2x 1.82 ratio, 1x 0.5 ratio: 200 x 140, 60 x 142, 300 x 165, 592 x 325 and 600 x 300 !! All from the one size feature image)
    Think I will have to devise a scaling such that even once cropped, the central portion is still visible

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello,

    sorry to hear you’re having problems.
    I don’t follow the first paragraph at all. There was no recent update to the plugin. 4 months ago)
    Where is this “click on “View” More” you mention?

    Would it be possible to use the filename rather than the ID

    No, that’s just not how WordPress works. But you can get the full url using:

    // Get the url of the 'thumbnail', replace 'thumbnail' with an other valid image size (like 'full') .
    $dfi_id = get_option( 'dfi_image_id' );
    echo wp_get_attachment_image_url( $dfi_id, 'thumbnail' );
    
    // Full server path.
    $dfi_id = get_option( 'dfi_image_id' );
    echo wp_get_original_image_path( $dfi_id );

    Also, the upload only allows a square image

    The DFI plugin does nothing with image sizes, that’s usually handled by the theme. I just set an image ID and pass it on as a featured image.

    Please let me know how it goes.
    Jan-Willem

    • This reply was modified 5 years ago by Jan-Willem.
    Thread Starter cristofayre

    (@cristofayre)

    First of, apologies. I got just about everything wrong !!

    When you hover over an image in media library list view, it shows “post_id=xxxx” I assumed that was the actual textual post it was assigned to show up on, and was looking for another ID number for the actual image. (I solved if by installing a plugin that shows ID numbers … and that showed the same number as the link in the status bar, ie “…/post.php?post=1893&action=edit&classic-editor”

    Apparentely, the “append” link shows if you upload images directly to the media library. Even if you then set the “featured image” of the post, it doesn’t associate that image with the page in the library. Seems it’s only “attached” if you use the upload feature image of the post setting. (Absolutely nothing to do with the plugin, but thought I’d clarify in case anyone else reads this post). You can manually ‘attach’ it to a post for ‘good housekeeping’

    The “only loading square images” was confusion caused by the ‘settings’ panel. Yes, it uploads the full image, but then crops the sides off when displaying it in the admin panel! (The other settings are set to default 150×150, 300×300 and 1024×1024, so that may be why the thumbhail is shown cropped. Helpfully(!), my theme uses NONE of these sizes. It uses 200 x 140, 60 x 42, 300 x 165, and 658 x 300 (I’m not gonna mess with the default sizings at this stage lest I foul things up) If I design image for the latter scroller, the other sizes get cropped so no longer make sense. I have now created the graphics such that the centre of the large image gets cropped to the aspect ratios above, and the slider image is ‘padded’ to the sides. (Again, just thought I’d add it here in case anyone faces a similar problem with images)

    So again, sorry to have ‘wasted’ your time, but I am grateful for the prompt response.

    Incidentally, I am using a plugin that allows people to post pending articles without entering the admin area. If they don’t add a featured image, your plugin should substitute a default graphic

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello,

    Good to hear it’s al clear now.
    If you run into problems with the frontend posts please let me know.
    I’ve had some problems with them in the past.

    Jan-Willem

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Post numbers and multiple thumbs’ is closed to new replies.