Hallo!
Ich habe für mein Weblog eine Gallerie-Übersicht erstellt, welche auf der von mir zusammengebastelten Vorlage gallery.php basiert.
PHP
<?php
/*
Template Name: gallery
*/
?>
<?php get_header(); ?>
<div id="home_content" class="column span-14"> <!-- start home_content -->
<div id="home_left" class="column span-11 first">
<h2 class="archive_name"><?php the_title(); ?></h2>
<?php $the_query = new WP_Query('category_name=bilder');
while ($the_query->have_posts()) : $the_query->the_post();
$do_not_duplicate = $post->ID; ?>
<div class="galoverview">
<?php $attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order'));
if ( ! is_array($attachments) ) continue;
$count = count($attachments);
$first_attachment = array_shift($attachments); ?>
<div class="set">
<a href="<?php the_permalink() ?>">
<?php echo wp_get_attachment_image($first_attachment->ID); ?>
</a>
</div>
<div class="galdescription">
<h3 class="archive_title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<div class="archive_post_meta">Von <?php the_author_posts_link(); ?> <span class="dot">⋅</span> <?php the_time('F j, Y'); ?> <span class="dot">⋅</span> <a href="<?php comments_link(); ?>"><?php comments_number('Kommentieren','Ein Kommentar','% Kommentare'); ?></a></div>
<?php the_excerpt() ?>
<p>Diese Gallerie enthält <?php echo $count ?> Bilder.</p>
</div>
</div>
<?php endwhile; ?>
<div class="navigation">
<p><?php next_posts_link('« Vorherige Galerien') ?> — <?php previous_posts_link('Naechste Galerien »') ?></p>
</div>
</div>
<?php get_sidebar(); ?>
</div> <!-- end home_content -->
<?php get_footer(); ?>
Alles anzeigen
Leider musste ich nun feststellen, dass die Navigation (Nächste / Vorherige Galerien) nicht funktioniert.
Hat jemand eine Idee, wie ich dieses Problem beheben kann?
Vielen Dank!