#18143 closed enhancement (fixed)
Add size for Gallery Settings
Reported by: | designsimply | Owned by: | nacin |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.2.1 |
Component: | Gallery | Keywords: | westi-likes has-patch |
Focuses: | Cc: |
Description
Add a size option for gallery settings so it's easy to insert a single column gallery with large or full size images.
Attachments (6)
Change History (33)
#1
@
14 years ago
- Keywords 3.3-early westi-likes added
- Milestone changed from Awaiting Review to Future Release
- Owner set to westi
- Status changed from new to accepted
- Version set to 3.2.1
#4
@
13 years ago
- Keywords ux-feedback added
Patch works, tested, looks good. +1
However, when choosing "Large" or "Full", I want to think that number of columns should be reduced from 3 to 1, and that "Medium" should reduce columns to 2. That also makes me think that Size should appear immediately above the Columns section, and thus below the order fields.
Anyone disagree? What I did was add two images as [gallery size="large"] but the theme applied certain CSS due to the three columns (which I didn't notice) and at first I couldn't figure it out. (I don't ever really use galleries, so treat me as a user here.)
#6
@
13 years ago
- Keywords 3.3-early ux-feedback removed
- Milestone changed from Future Release to 3.4
Fine by me.
#9
follow-up:
↓ 10
@
11 years ago
Bumping this out of the dark ages. To change the size you have to go into the text editor and add a shortcode parameter. Easy, if annoying, for someone familiar with WP. Unlikely for someone who isn't. The rest of the gallery UI is pretty sweet, the lack of an image size parameter seems like an oversight.
#10
in reply to:
↑ 9
@
11 years ago
@helgatheviking: It's really funny that you bumped this ticket, because I actually have plans to to give it a go this week, to see if I can update the patch from @designsimply, so keep your eyes peeled for it! :)
#11
follow-up:
↓ 12
@
11 years ago
Glad to hear it! The shortcode parameter is already there and working, so you need to add the form and send the parameter to the editor. If someone can point me to a tutorial on how to test patches via git (i'm longing for WP to move to Git or at least become truly version control agnostic) I'd be happy to test what you come up with.
#12
in reply to:
↑ 11
@
11 years ago
Replying to helgatheviking:
If someone can point me to a tutorial on how to test patches via git (i'm longing for WP to move to Git or at least become truly version control agnostic) I'd be happy to test what you come up with.
The patch
command is Unix, not VCS-dependent. We're pretty VCS-agnostic unless you're a committer, but even then, some committers use Git for everything but the commit itself.
#13
@
11 years ago
Sorry it took so long to get this updated, but here is my patch, finally. I took @sheri's diff and added my own modifications to it. The thing is, I'm not sure if all of the changes are actually necessary, especially the ones in media.php. I banged my head against that for a while before I stumbled upon media-template.php.
#14
@
11 years ago
Thank you.
Seems as it is working OK. Probably wont be difficult to put custom image sizes.
I like that Jetpack carousel remove next/prew arrows when it is only one image.
And believe it is not 3.9.1 files, some lines numbers dont match. And also it is not easy to see when to add new lines, when to overwrite old lines.
Have to ask will it come into core or will we have to change files every time we upgrade WP ?
#15
@
11 years ago
@tagger Lee: Thanks for your comments. I actually want to revisit my patch over the next few days, I have a sneaking suspicion I missed something and so I have a couple of things I want to check.
Have to ask will it come into core or will we have to change files every time we upgrade WP ?
This will hopefully be merged into Core if the patch gets accepted.
#16
@
11 years ago
Please give us few lines of code for functions.php. If it is not so much work to implement.
To have own image sizes.
Only reason for this would be to not change everything again when WP updates.
#20
@
10 years ago
I somehow didn't find this ticket, sorry.
Here's my patch for this in the current trunk (4.0-).
It still needs testing to make sure that it doesn't effect any other parts of WP.
#24
@
10 years ago
For all those who cannot wait here is nice snippet for functions.php:
Some workaround, but not as GUI option.
function gallery_shortcode_change_default_size( $out, $pairs, $atts ) { if ('1' == $atts['columns']) { $out['size'] = 'gallery-thumbnail-l'; } elseif ('2' == $atts['columns']) { $out['size'] = 'gallery-thumbnail-2'; } elseif ('3' == $atts['columns']) { $out['size'] = 'gallery-thumbnail-3'; } elseif ('' == $atts['columns']) { $out['size'] = 'gallery-thumbnail-3'; } return $out; } add_filter( 'shortcode_atts_gallery', 'gallery_shortcode_change_default_size', 10, 3 );
#26
@
10 years ago
I just noticed this solution makes a lot of problems with different scenarios.
How would now theme developers make SVG icons marking on blog list if a post has gallery. One image (one columns) is not precise a gallery, all posts with one image will be marked as post with galleries. I already have this problem on one website i testing this on.
And several other scenarios as well too.
Not good at all, not good.
Could you just make Jetpack carousel work even with simple and single images in post/pages/widgets ? What is so big deal, all lightbox plugins are already doing this.
Seems as less headache.
PS: Dont know what this option at the bottom "Reopen" is and if i may use it.
#27
@
10 years ago
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 --> }
I thought there was a filter on Thumbnail/Medium/Large/Full in image_size_input_fields() that we could apply here, but there isn't.