[wp-trac] [WordPress Trac] #18143: Add size for Gallery Settings
WordPress Trac
noreply at wordpress.org
Mon Mar 16 11:39:49 UTC 2015
#18143: Add size for Gallery Settings
-----------------------------------+---------------------
Reporter: designsimply | Owner: nacin
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.1
Component: Gallery | Version: 3.2.1
Severity: normal | Resolution: fixed
Keywords: westi-likes has-patch | Focuses:
-----------------------------------+---------------------
Comment (by Stagger Lee):
Just to write this snippet. For people who customize Blog lists in themes.
This is in the core now and putting "one-image" gallery and showing icon
on Blog list that Post has gallery would be cheating in some way. One
image is not gallery. This snippet takes care of it, goes in template
loop:
(I used and activated Font Awesome SVG icons)
{{{
$attachments = get_children(
array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'post_parent' => $post->ID
));
if(count($attachments) > 2) {
// <!-- Do something like show a slider -->
$video_ids = '<i class="fa fa-picture-o"></i>';
} else {
// <!-- Display a single image -->
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/18143#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list