WordPress.org

Ready to get started?Download WordPress

Forums

Flexible Posts Widget
[resolved] Remove image size when used in responsive theme (3 posts)

  1. oceanazul
    Member
    Posted 9 months ago #

    Hi,

    I am wondering what code i need to change here,, in order that the thumbnail images have no set size, and can be controlled by my theme CSS wich states width:100%; height:auto :

    <?php
    if( $thumbnail == true ) {
    // If the post has a feature image, show it
    if( has_post_thumbnail() ) {
    the_post_thumbnail( $thumbsize );
    // Else if the post has a mime type that starts with "image/" then show the image directly.
    } elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
    echo wp_get_attachment_image( $post->ID, $thumbsize );
    }
    }
    ?>

    Curently, when using Firebug, i can see that it's taking the thumbnail size as stated in my WP Media Settings. However, images elsewhere on my site and in other plugins don't seem to be affected by those Media settings, which i prefer.

    thanks in advance of any help anyone can offer.

    http://wordpress.org/plugins/flexible-posts-widget/

  2. DaveE
    Member
    Plugin Author

    Posted 8 months ago #

    Hi oceanazul,

    There isn't really a way to "disregard" image sizes in WordPress. In order to get an image from WordPress, you have to tell it what size to get. There are a number of predefined sizes available.

    That being said WordPress allows you to get the original image as it was uploaded using the size full. FPW doesn't currently have an option to get the "full" size image because this is generally a bad idea since that would mean a full-resolution image from a digital camera (5mb-6mb or more) could potentially be sent to ever visitor's browser. You can override this limitation by creating a custom HTML template and then changing out the line that says:

    the_post_thumbnail( $thumbsize );

    to:

    the_post_thumbnail( 'full' );

    Thanks for using the plugin!

  3. oceanazul
    Member
    Posted 8 months ago #

    Hi Dave,

    Thanks for responding, i'll research that workaround you suggested :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.