Last active
January 11, 2016 05:19
-
-
Save GaryJones/9530251 to your computer and use it in GitHub Desktop.
Default styles for HTML5 galleries and captions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gallery { | |
margin: auto; | |
} | |
.gallery-item { | |
float: left; | |
margin-top: 10px; | |
text-align: center; | |
} | |
.gallery-columns-2 .gallery-item { | |
width: 50%; | |
} | |
.gallery-columns-3 .gallery-item { | |
width: 33%; | |
} | |
.gallery-columns-4 .gallery-item { | |
width: 25%; | |
} | |
.gallery-columns-5 .gallery-item { | |
width: 20%; | |
} | |
.gallery-columns-6 .gallery-item { | |
width: 16.6666%; | |
} | |
.gallery-columns-7 .gallery-item { | |
width: 14.2857%; | |
} | |
.gallery-columns-8 .gallery-item { | |
width: 12.5%; | |
} | |
.gallery-columns-9 .gallery-item { | |
width: 11.1111%; | |
} | |
.gallery img { | |
border: 2px solid #cfcfcf; | |
} | |
.gallery-caption { | |
margin-left: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amended from the old default styles - see gallery_shortcode() in wp-includes/media.php