choose image to be displayed
-
https://www.bootjesgek.com
All our posts contain one or more images. For articles with more than one image, a thumbnail is displayed on the home and archive pages; and a big picture in the carousel on the homepage. I seem to have no contol over what image is chosen. I would like to be able to chose the right image myself. The code that I think is responsable is in functions.php:
‘# Displays post image attachment (sizes: thumbnail, medium, full)
function dp_attachment_image($postid=0, $size=’articleimg’, $attributes=”) {
if ($postid<1) $postid = get_the_ID();
if ($images = get_children(array(
‘post_parent’ => $postid,
‘post_type’ => ‘attachment’,
‘numberposts’ => 1,
‘post_mime_type’ => ‘image’,)))
foreach($images as $image) {
$attachment=wp_get_attachment_image_src($image->ID, $size);
?><img src=”<?php echo $attachment[0]; ?>” <?php echo $attributes; ?> /><?php
}
}’
- The topic ‘choose image to be displayed’ is closed to new replies.