I've found a way to insert a customized gallery inside my wordpress template but I'm not sure this is the better way.
I've uploaded my images with the default image uploader of wordpress to manage the photos, than I've removed it from the post article and managed the media from the loop-single.php
page template I've created like this:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<header>
<script type="text/javascript">
/* gallery */
var params = {
autostart:true,
easing:'easeInOutExpo',
transition:750
};
var gallery = new ImgGalleryManager ('#site-gallery', '#gallery-menu', 'selected', params);
/* */
</script>
<?php
$args = array(
'order' => 'ASC',
'post_type' => 'attachment',
'post_parent' => $post->ID,
'post_mime_type' => 'image',
'post_status' => null,
'numberposts' => -1,
);
$attachments = get_posts($args);
if ($attachments) {
$html = '<div id="site-gallery">
<table>
<tr>';
foreach ($attachments as $attachment) {
//echo apply_filters('the_title', $attachment->post_title);
$html .= '<td>'. wp_get_attachment_link($attachment->ID, 'full', false, false).'</td>';
if (empty($list_imgs)) {
$list_imgs = '<div id="gallery-menu"><div class="img-selector selected"></div>';
} else {
$list_imgs .= '<div class="img-selector"></div>';
}
}
$html .= '</tr>
</table>
</div>'.$list_imgs.'</div>';
echo $html;
}
?>
</header>
<div id="cnt-title"><?php the_title(); ?></div>
<div id="post-content">
<?php the_content(); ?>
</div>
<div>
<?php the_tags(); ?>
</div>
<?php endwhile; // end of the loop. ?>
I can't believe this is the best way to manage photos but I don't know wordpress and I've did the first thing I thought.
Should I use a better way to custom the image gallery of a post or is this the best way?
Is it possible to customize the [gallery]
in the loop-single.php
page without remove it and create it manually?
I've read here how to customize the gallery, but if I do it I'll print the customized gallery, and than with <?php the_content(); ?>
I'll print it again with the default wordpress style.
Does exists some way to customize [gallery]
directly?