Ich lese mithilfe eines Custom Query ein Paar daten aus, die dann in einem foreach loop nacheinander eingefügt werden.
Nun möchte ich aber dass nach 5 "posts" eine neue seite angefangen wird damit das ganze nicht unübersichtlich wird.
code:
PHP
<?php
global $wpdb;
$id = get_the_ID();
$querystring = "SELECT * FROM wp_candle WHERE id = $id";
$results = $wpdb->get_results( $querystring ,OBJECT);
foreach($results as $result)
{
echo
'<div class="kerzenbox clearfix">
<article class="post boxrechts" id="">
<h2> "'.$result->contactName.'" </h2>
<p> "'.$result->worte.'" </p>
<img src="http://localhost/wordpressdb/wp-content/uploads/2017/02/18135-FX-6-0-13-6-9-0-1.jpg" width="50" height="70"/>
</article>
</div>';
}
?>
Alles anzeigen