Last active
February 17, 2021 15:38
-
-
Save gdnwebmedia/143831a8d940d4a8514687b96f11b966 to your computer and use it in GitHub Desktop.
Add Pods Admin based images in your template file
This file contains hidden or 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 | |
// use class .gal-single for additional styling | |
// get pods object | |
$custom_field_name = 'custom_portlofio_gallery'; | |
$mypod = pods( $post->post_type, $post->ID ); | |
if ($mypod->field($custom_field_name)) { | |
foreach( $mypod->field('custom_portlofio_gallery', true) as $picture) { | |
echo '<div><img src="' . $picture['guid'] . '" class="gal-single" width="100%" height="auto" alt="' . $picture['post_title'] . '" /></div>'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment