Code Monkey home page Code Monkey logo

wp-tevko-responsive-images's Introduction

RICG-responsive-images

Bringing automatic default responsive images to wordpress.

This plugin works by including all available image sizes for each image upload. Whenever wordpress outputs the image through the media uploader, or whenever a featured image is generated, those sizes will be included in the image tag via the srcset attribute.

##Hardcoding in template files

You can output a responsive image anywhere you'd like by using the following syntax:

<img src="pathToImage" <?php echo tevkori_get_srcset_string( TheIdOfYourImage, theLargestImageSizeNeeded ); ?> />

ex.)

<img src="myimg.png" <?php echo tevkori_get_srcset_string( 11, 'medium' ); ?> />

##Version

2.1.0

##Changelog

  • This version introduces a breaking change - there are now two functions. One returns an array of srcset values, and the other returns a string with the srcset=".." html needed to generate the responsive image. To retrieve the srcset array, use tevkori_get_srcset_array( $id, $size )

  • When the image size is changed in the post editor, the srcset values will adjust to match the change.

2.0.2

  • A bugfix correcting a divide by zero error. Some users may have seen this after upgrading to 2.0.1

2.0.1

  • Only outputs the default wordpress sizes, giving theme developers the option to extend as needed
  • Added support for featured images

2.0.0

  • Uses Picturefill 2.2.0 (Beta)
  • Scripts are output to footer
  • Image sizes adjusted
  • Most importantly, the srcset syntax is being used
  • The structure of the plugin is significantly different. The plugin now works by extending the default wordpress image tag functionality to include the srcset attribute.
  • Works for cropped images!
  • Backwards compatible (images added before plugin install will still be responsive)!

wp-tevko-responsive-images's People

Contributors

tevko avatar joemcgill avatar mdmcginn avatar barryceelen avatar chriscoyier avatar micahmills avatar kingkool68 avatar mattbagwell avatar ryelle avatar

Watchers

James Cloos avatar Mathew Tyler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.