What is the best way for me to loop through this array of wordpress post ids and generate a linked image.
I currently have:
<?php
$posts = array(1309,880,877,890,1741,1739,2017);
print "<div class='row'>";
foreach($posts as $post){
$queried_post = get_post($post);
echo "<a href='get_permalink( $post )'>";
print "<div class='col-xs-2'>";
echo get_the_post_thumbnail($queried_post->ID, 'thumbnail');
print "</div>";
print "</a>";
}
print "</div>";
?>
I come from a ruby background and am pretty sure using print won't be the most effecient way to open and close html within the php call.
At the moment this doesn't work as it's not passing the post id correctly into the it's giving me this /get_permalink(%20880%20) in the URL.
Thanks in advance for any help.