Я хочу разбиение на страницы в соответствии с результатами, поступающими из базы данных wordpress... Это все сделано на моей странице параметров плагина wordpress..
Мой код для извлечения из базы данных выглядит следующим образом
$per_page=5;
$sql = "SELECT * FROM wp_dive ";
$result = $wpdb->get_results($sql_10) or die(mysql_error());
$length=count($result);
$pages = ceil($length/$per_page);
foreach( $result as $results )
{
$id=$results->id;
$name= $results->name_cust;
$gender= $results->gender_cust;
$dob= $results->dob_cust;
<?php $html= "<div class=\"divContentBody\">";?>
<?php $html .= "<span class=\"clsOrderNo\">". $id."</span>";?>
<?php $html .= "<span class=\"clsName\">". $name."</span>";?>
<?php $html .= "<span class=\"clsGender\">".$gender."</span>";?>
<?php $html .= "<span class=\"clsDOB\">". $dob ."</span>";?>
<?php $html .= "</div>"?>
<?php
$data_html .=$html;
}
?>
Я получаю данные динамически.. Я просто хочу добавить разбивку на страницы.. показать 5 записей на первой странице и соответственно...