[wp-testers] Gallery CSS/xHTML

Spencer Lavery phobea at gmail.com
Fri Mar 28 00:11:13 GMT 2008


The CSS and xHTML should be part of the 'Default' theme, or any theme
for that matter - injecting them within the post not only forces users
to edit the core files in order to change their appearance, but it's
also adding <style> tags, and inline CSS (<br style="clear:all;">)
which is breaking validation.

Instead of forcing each image to be wrapped in a DL, add some new WP
template tags for targeting the gallery specifically inside the loop,
for example:

<?php if (have_gallery()) : ?>
<dl class="gallery">
<?php while (have gallery()) : the_gallery(); ?>
<dt><?php the_thumbnail(); ?>
<?php endwhile; ?>
<?php endif; ?>

This could allow themers to pass variables such as thumbnail size
directly into the template tag, i.e:

<?php the_thumbnail('width=120&height=120&crop=1'); ?>

This way of doing things would also give themers much, much more
flexibility with using gallerys in other areas of the theme such as
the sidebar. Another benefit would be the ability to target
the_thumbnail, the_medium_image and the_fullsize_image respectively.

I apologise if this is already in production, I just feel that the new
Gallery is such an awesome feature that it deserves to be easier to
use, and easier to work with for themers and standard users alike.

Spencer Lavery.


More information about the wp-testers mailing list