Hello,
I have several images attached to a post. What I would like to do is to create a custom html for all the images in a way that featured image always appears first and is of a bigger size than all other images.
I've noticed that when you mark an image in File Gallery as featured it doesn't necessarily appears first.
I'm using the following code within a template (see below), so that I can go through each image and create custom html for them.
How can I make sure that a featured image appears first and is of different size, and potentially have a bit different html? Do I need to make 2 separate calls to file_gallery_shortcode function?
$images_args = array(
'order' => 'ASC',
'orderby' => '',
'id' => $post->ID,
'columns' => 3,
'size' => 'thumbnail',
'link' => 'attachment',
'linkclass' => '',
'imageclass' => '',
'rel' => 1,
'tags' => '',
'tags_from' => 'current',
'output_type' => 'array',
'output_params' => 1,
'attachment_ids' => '',
'mimetype' => '',
'limit' => -1
);
$images = file_gallery_shortcode( $images_args );
foreach($images as $image) {
<my-html-code-per-each-image>
}
P.S. would be great to have a more detailed description for file_gallery_shortcode function (what can be used in 'orderby', what do 'columns' mean) for beginner programmers :)