Last active
December 6, 2016 19:31
-
-
Save peterwegren/ea401532879a118fb18685ea4ae3cdac to your computer and use it in GitHub Desktop.
Waldo - multiple images, single page/template.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$image = get_field('section_image_1'); | |
$waldo_class = 'section-image-1'; | |
$waldo_styles = $waldo->waldoStylesArray($image, $waldo_class, $waldo_styles, $waldo_class); | |
$image = get_field('section_image_2'); | |
$waldo_class = 'section-image-2'; | |
$waldo_styles = $waldo->waldoStylesArray($image, $waldo_class, $waldo_styles, $waldo_class); | |
$image = get_field('section_image_3'); | |
$waldo_class = 'section-image-3'; | |
$waldo_styles = $waldo->waldoStylesArray($image, $waldo_class, $waldo_styles, $waldo_class); | |
// OR | |
// use a loop if it makes sense for your page/template | |
for ($i=1; $i <= 3; $i++) { | |
$image = get_field('section_image_' .$i); | |
$waldo_class = 'section-image-' .$i; | |
$waldo_styles = $waldo->waldoStylesArray($image, $waldo_class, $waldo_styles, $waldo_class); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment