J'ai trouvé un début d'idée ici [url=http://www.screenfeed.fr/blog/du-pola-dans-wordpress-customiser-les-galeries-0132/]http://www.screenfeed.fr/blog/du-pola-dans-wordpress-customiser-les-galeries-0132/[/url] Sans toucher le css parce que ce tuto transforme les images de la galerie en polaroïd. Voici donc le code à transformer : [code]// ----------------------------------------------------------------------------- gallery ----------------- add_filter('post_gallery', 'sf_post_gallery', 10, 2); function sf_post_gallery(null, $attr = array()) { global $post, $wp\_locale; static $instance = 0; $instance++; // We don't need the "apply\_filters" function here, unless you want to mess up all. So we delete it // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize\_sql\_orderby( $attr['orderby'] ); if ( !attr['orderby'] ) unset( attr['orderby'] ); } extract(shortcode\_atts(array( 'order' => 'ASC', 'orderby' => 'menu\_order ID', 'id' => $post->ID, 'itemtag' => '', // We don't need 'dl' 'icontag' => '', // We don't need 'dt' 'captiontag' => '', // We don't need 'dd' 'columns' => 3, 'size' => 'medium', // We'll use medium instead of thumbnail 'include' => '', 'exclude' => '' ), $attr)); $id = intval(id); if ( 'RAND' == order ) $orderby = 'none'; if ( !empty(include) ) { include = preg\_replace( '/[^0-9,]+/', '', $include ); $\_attachments = get\_posts( array('include' => $include, 'post\_status' => 'inherit', 'post\_type' => 'attachment', 'post\_mime\_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); foreach ( $\_attachments as $key => $val ) { $attachments[val->ID] = \_attachments[key]; } } elseif ( !empty(exclude) ) { $exclude = preg\_replace( '/[^0-9,]+/', '', $exclude ); $attachments = get\_children( array('post\_parent' => $id, 'exclude' => $exclude, 'post\_status' => 'inherit', 'post\_type' => 'attachment', 'post\_mime\_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get\_children( array('post\_parent' => $id, 'post\_status' => 'inherit', 'post\_type' => 'attachment', 'post\_mime\_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } if ( empty(attachments) ) return ''; if ( is_feed() ) { output = "\n"; foreach ( $attachments as $att\_id => $attachment ) $output .= wp\_get\_attachment\_link(att_id, size, true) . "\n"; return $output; } $itemtag = tag\_escape(itemtag); captiontag = tag\_escape(captiontag); columns = intval(columns); itemwidth = $columns > 0 ? floor(100/columns) : 100; $float = is_rtl() ? 'right' : 'left'; $output = "
"; // We don't need the style tag, so we delete it if(itemtag != '' && $icontag != '' && $captiontag != '') { // If we have specified the tags in the shortcode, let's use them with the original structure $i = 0; foreach ( $attachments as $id => $attachment ) { $link = isset(attr['link']) && 'file' == attr['link'] ? wp\_get\_attachment\_link(id, size, false, false) : wp\_get\_attachment\_link(id, size, true, false); $output .= ""; $output .= " $link {icontag}>"; if ( captiontag && trim(attachment->post_excerpt) ) { output .= " " . wptexturize(attachment->post_excerpt) . " {captiontag}>"; } $output .= "{itemtag}>"; if ( columns > 0 && ++i % columns == 0 ) $output .= '
'; } } else { // Else, we use our custom gallery foreach ( $attachments as $id => $attachment ) { $thumb = wp\_get\_attachment\_image\_src( $id, $size ); // We get the medium size image representing, it returns an array [url] [width] [height] $caption = wptexturize(attachment->post_excerpt); // The caption text output .= '[caption id="attachment\_'.id.'" align="alignleft" width="'.thumb[1].'" caption="' . $caption . ' "]'; // We use the caption shortcode if (isset(attr['link']) && 'file' == attr['link']) { // If we want to link directly to the file $image = wp\_get\_attachment\_image\_src( $id, 'full' ); // We get the full size image representing, we'll use it to retrieve its url with $image[0] $output .= ' ['; // The link: $image[0] is the url, we put a rel attribute for a lightbox (you can put what you want) $output .= ' '; // The "thumbnail" output .= ']('.image[0].')'; } else { output .= wp\_get\_attachment\_link(id, size, true, false); // Link to the attachment page } $output .= '[/caption] '; // We close the caption shortcode } $output = do\_shortcode(output); // We finally apply a do_shortcode for the... caption shortcodes } $output .= "
\n"; // Clear the thumbs floats and close the gallery div return $output; }[/code] Là je suis perdu lol, si une âme charitable pouvait regarder de plus près. Merci infiniment ;-)