Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Nelio Software

    (@nelio)

    Hi, Juan! Actually, our plugin does use the width and height your theme defined. This is how our plugin works:

    • We hook into a function called (get_)the_post_thumbnail.
    • One of the parameters of this function (which may or may not be initialized) is $size.
    • This size is, as you can imagine, defined by your theme. If the $size parameter is set, we use it to set the width and height of the featured image (using inline CSS properties).
    • If $size is not set, then we rely on your theme’s CSS files, which, again, may define the width and height of your featured images.

    Unfortunately, the previous workflow does not always guarantee that you’ll get proper results. That’s why you may need to add custom CSS rules for tweaking the featured images. In those cases, the img tag has a new class (nelioefi) that will ease the definition of specific rules for external featured images: img.nelioefi.

    In conclusion, I think you’ll have to add custom CSS rules for setting the appropriate sizes to your featured images.

    Best,
    The Nelio Team

    Hi, I just wanted to add a comment, since I believe it’s similar to the above.

    I love your plugin so far, but the first image I tested it in came in at a massive size, and I’m just looking for tiny 100x100px thumbnails next to each story. I didn’t see any size settings in the widget, so I had to add a messy CSS rule to force the size down. Right now it looks like this (“enterprise” is the name of my theme):

    img.attachment-enterprise_featured_image.featured-img.wp-post-image.nelioefi {
    float: right !important;
    border: 1px solid #eee !important;
    margin-left: 1em !important;
    width: 100px !important;
    height: 100px !important;
    }

    I had to use “!important” because the style for img.attachment-enterprise_featured_image.featured-img.wp-post-image.nelioefi is somewhere I can’t find, and it refused to be overridden. But the style above works! It’s just incredibly messy, and reveals me to be the newbie I am.

    So I guess my question is: is the above the best I can expect, or is there a better way I should be doing this?

    Thanks for your patience. I am clearly no expert at WP.

    Plugin Author David Aguilera

    (@davilera)

    Hi @scampercom!

    First of all, remember that external featured images will not be scaled down. If you know that those images won’t be bigger than 100x100px anywhere, I recommend you use smaller images (keep in mind that your visitors will have to download them, and the bigger they are, the longer it takes to retrieve them).

    That said, I’m afraid you’re right: the only way to fix the size of a featured image is defining a CSS rule and overriding “default” sizes. And sometimes that involves using the !important directive. Luckily, the CSS rule is very specific, which means it’ll only affect the relevant elements!

    Okay, thank you for following up. I’m loving the plugin, and my hack is giving me exactly the look I’m going for, so I have no complaints! As you say, the source images are (usually) far larger than 100x100px, but I have no visitors, so I don’t mind. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘image size’ is closed to new replies.