Hallo,
ich suche die Möglichkeit, eine Pagination am Ende meines Wordpress-Loops zu verwenden. Ich hatte mir etwas in der folgenden Richtung vorgestellt: http://prnt.sc/b3xgq1
Leider habe ich keine Ahnung, wie ich das umsetzen kann. Ich habe schon einiges probiert, aber nie wurde etwas in der Art angezeigt.
Das ist mein Wordpress-Loop:
PHP
<main id="main">
<?php
// the query
$args = array('posts_per_page' => 2 );
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) { ?>
<!-- loop -->
<?php while ( $the_query->have_posts() ) {
$the_query->the_post(); ?>
<article id="post">
<div id="thumbnail">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail(); } ?>
</div>
<h2><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2>
<div class="entry">
<?php the_excerpt(); ?>
</div>
</article>
<?php } } else { ?>
<p><?php _e( 'Die Posts entsprechen nicht den Kriterien.' ); ?></p>
<?php } ?>
<!-- end of the loop -->
<?php wp_reset_postdata(); ?>
<div id="pagination">
</div>
</main>
Alles anzeigen
Kann mir jemand erklären, was ich wo einfügen muss? Ich habe mal einen DIV-Container erstellt, weiß aber nicht, ob der da richtig ist.