-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gallery definition lists do not validate #41
Comments
I've just been doing some thinking/reading/coding around images and captions, and for The Photographic Journal I'm using
What we lose is the unformatted list presentation, but this too is easy: put each
and problem solved. Styling an unordered list is such a common practice that it actually ends up being a better combination of elements than the definition list, which I find can be a bitch sometimes when you want to keep the Thoughts? :) |
Brilliant. Why I hadn’t I thought about the I would consider leaving out the unordered list elements altogether, as they do add quite a bit more markup. I’d like to test both ways and see how HTML5 Shiv handles the backwards compatibility, if we leave out the list. |
No disagreement; was only thinking the |
This slick chunk of code that Chris found could help a lot. It adds a filter to the function html5_insert_image($html, $id, $caption, $title, $align, $url) {
$html5 = "<figure id='post-$id media-$id' class='align-$align'>";
$html5 .= "<img src='$url' alt='$title' />";
if ($caption) {
$html5 .= "<figcaption>$caption</figcaption>";
}
$html5 .= "</figure>";
return $html5;
}
add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 ); |
The following function added in WordPress 3.6 implements HTML5 markup in various places, including the gallery.
https://codex.wordpress.org/Theme_Markup This function was added to theme in commit 7da1420 |
Related to issue #62 |
The definition lists that are used to display gallery content do not validate if an image does not have a caption associated with it. The image caption is normally placed within the list’s
<dd>
element. If the caption is not present, the<dd>
element is not rendered, causing the list to not validate.One solution owuld be to change the gallery thumbnail and image layouts to something other than definition lists. Otherwise, we could simply render out an empty or “untitled”
<dd>
element.The text was updated successfully, but these errors were encountered: