Hallo Leute,
ich habe ein kleines Problem. In meinem Theme gibt es die Möglichkeit eine Post als Featured Post zu markieren. Daneben gibt es eine weitere Sektion, im Quelltext "headlines" genannt, die 5 weite Postings angibt.
Das Problem ist nun folgendes: Ich würde gerne auf der unteren Seite eine Navigation zu den nächsten Seiten einbauen. Das problem ist nur, dass der Loop nicht komplett ausgeführt wird, also die nächste Seitegenau so aussieht wie die erste Seite.
Ziel: Der featured post soll aus dem normalen Loop der Startseite ausgeklammert werden.
Hier der Quelltext:
Hier der Quelltext:
PHP
<?php $my_query = new WP_Query(array('meta_key'=>'_featured','meta_value'=>'TRUE','showposts'=>1,'caller_get_posts'=>1)); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); $ignore[] = $post->ID; ?>
<div id="feature" class="clearfix">
<h3 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php the_content('keep reading →'); ?>
<p><?php the_time('j. F Y') ?> • <?php comments_popup_link('Keine Kommentare', '1 Kommentar', '% Kommentare'); ?> • <a href="<?php the_permalink(); ?>">weiter lesen »</a></p>
</div><!--end #feature-->
<?php endwhile; //do not delete ?>
<div id="headlines">
<?php $my_query = new WP_Query(array('post__not_in'=>$ignore,'caller_get_posts'=>1)); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); // the loop ?>
<div class="post">
<h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php the_content('weiter lesen →'); ?>
<div class="infos" align="right"><p><?php the_time('j. F Y') ?> • <?php comments_popup_link('Keine Kommentare', '1 Kommentar', '% Kommentare'); ?> • <a href="<?php the_permalink(); ?>">weiter lesen »</a></p></div>
</div>
<?php endwhile; //do not delete ?>
<div class="page-nav">
<div class="nav-previous"><?php previous_posts_link(__('← Vorherige Artikel')) ?></div>
<div class="nav-next"><?php next_posts_link(__('Nächste Artikel →')); ?></div>
</div>
</div>
Alles anzeigen