Hallo Forum,
ich beiße mir die Zähne aus - hat jmd einen Tipp?
Ich habe zwei Loops
1. Loop (sidebar):
PHP
<?php $do_not_duplicate = array(); ?>
<?php query_posts($query_string . '&cat=1'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();$do_not_duplicate[] = get_the_ID(); ?>
<div class="post">
<!-- Display the Title as a link to the Post's permalink. -->
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
?>
<div class="gallery-thumb"> <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a> </div>
<!-- .gallery-thumb -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a></h2>
<?php endif; ?>
<?php the_excerpt(); ?>
</div>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
Alles anzeigen
2. Loop (loop-single):
PHP
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a></h2>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
<?php endwhile; ?>
Der erste Loop ist meine Navigation (soll ein Teaser werden - immer sichtbar, auf jeder Seite gleich) und der zweite Loop der Inhalt. Wenn ich nun "navigiere" werden mir im Inhalt (2. Loop) immer alle Artikel ausgegeben. Wie kann ich das unterbinden? Die Lösungsansätze im Forum haben mir leider nicht weiter geholfen :-(
Komischerweise ist der Title immer korrekt.
Danke & Gruß,
Jappi