Skip to content

Implement WPThumb for dynamic Post Thumbnails #40

@BoweFrankema

Description

@BoweFrankema

WPThumb allows us stop generating several post thumbnail sizes in our themes. We simply set add one image-size and then serve the proper image sizes directly in our custom templates or and template parts.

Since it integrates with the native post_thumbnail function nothing will change besides that we'll be passing an array that gives the exact sizes needed:

<?php the_post_thumbnail( array( 'width' => 500, 'height' => 500, 'crop' => true ) ) ?>

Because we're dealing with responsive designs we could allow the user to modify the width through either the options panel or the ini files.

 <?php the_post_thumbnail( $post-thumbnail-option-size ) ?>

[infinity-thumbnail.width]
type = "css/length-px"
title = "Width"
description = "Select the width of the default post thumbnail"
min = 400
max = 1250
step = 1
    default_value = 670

Another big advantage is the flexibility when it comes to creating slider and grid images (like on the homepage of http://infinitythemes.net).

Not to mention that Featured images resize properly across different Infinity Themes with bloating the database.

More info about WPThumb:
https://github.com/humanmade/WPThumb
http://hmn.md/introducing-wp-thumb/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions