Skip to content

Commit 60b91dc

Browse files
committed
Instruction added for use in template files
1 parent dc88693 commit 60b91dc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

readme.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
This plugin tells WordPress to create three additional sizes for images you upload. Then it outputs special HTML (via a shortcode) that works with the Picturefill library to achieve responsive images in content.
22

33
### Usage
4-
4+
5+
Shortcode -
56
[responsive imageid="12" size1="0" size2="500" size3="1000"]
67

8+
PHP (use in template files) -
9+
10+
<span data-picture>
11+
<?php
12+
$image = 'the id of your image';
13+
$mappings = array(
14+
0 => 'small-img',
15+
250 => 'large-img',
16+
1000 => 'full-width'
17+
);
18+
?>
19+
<?php echo getPictureSrcs($image, $mappings) ?>
20+
<noscript> <?php echo wp_get_attachment_image($image, $mappings[2]) ?> </noscript>
21+
</span>
22+
723
### Prereqs
824

925
Make sure your current theme has

0 commit comments

Comments
 (0)