Opened 17 years ago
Closed 17 years ago
#9400 closed defect (bug) (duplicate)
Gallery column number inline CSS issue
| Reported by: | ECodeStudio | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Gallery | Version: | 2.7 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
Having more than one gallery on a single page causes the latest one in code to override the "number of columns" property of the above ones.
This issues is easily fixed by adding the gallery id attribute.
Here is a code snippet to go into wp-includes/media.php
$output = apply_filters('gallery_style', "
<style type='text/css'>
#gallery-{$id} .gallery {
margin: auto;
}
#gallery-{$id} .gallery-item {
float: left;
margin-top: 10px;
text-align: center;
width: {$itemwidth}%; }
#gallery-{$id} .gallery-icon img {
border: 1px solid #cfcfcf;
}
#gallery-{$id} .gallery-caption {
margin-left: 0;
}
</style>
<!-- see gallery_shortcode() in wp-includes/media.php -->
<div class='gallery' id='gallery-{$id}'>");
Attachments (2)
Change History (13)
#3
@
17 years ago
- Keywords needs-patch added; gallery column number inline css removed
- Milestone Unassigned → 2.8
patch isn't good. it also needs to modify the css.
@hakre: there is a dup or two of this bug somewhere. But basically, what happens is:
- create 3 posts, the first and last with galleries that have 3 columns, and the one in the middle with 2 columns.
- display the blog page
notice that they all have the same number of columns. the suggested change fixes this quite well. much better than what was suggested in the related tickets.
#5
@
17 years ago
- Keywords reporter-feedback added
Denis-de-Bernardy: So what to suggest. Just close this ticket? (would be fine with that).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
ECodeStudio, do you know how you can create a patch file? I do one, so you can take a look.