WordPress.org

Ready to get started?Download WordPress

Forums

Featured Images (4 posts)

  1. KJS1982
    Member
    Posted 2 years ago #

    Hi,
    Does anyone know why my featured images have started appearing incorrectly?
    I was adding products to my site with featured images yesterday, and the size of them was fine.
    I'm not doing anything different today and it's changed.
    Altering the image properties does nothing.
    Any ideas?
    Thanks!
    KJ.

  2. klevismiho
    Member
    Posted 2 years ago #

    I don't know why, but I get the featured images links, then this link I'll add to an img tag, and put the width and height to the image, like this:

    <?php
    //get image url
    $image_id = get_post_thumbnail_id();
    $image_url = wp_get_attachment_image_src($image_id,'large');
    $image_url = $image_url[0];
    ?>
    <img src="<?php echo $image_url; ?>" width="100" height="100" />

    So you will be sure that the image is of this size.

  3. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    @KJS1982: Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.

    @klevismiho: That's not how the core featured image functionality works.

  4. klevismiho
    Member
    Posted 2 years ago #

    Yes its true esmi, but it's a workaround.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.