I have one field in admin panel name PostDisplay,when i enter 3 in postDisplay then on post page (frontside) it will display 3 post, my question is when i enter 20 in postDisplay it display 20 post but i want a pagination on page thus page 1 display 5 post 2nd page next 5 and so on, this is my php page which get data and display post.
<?php
include_once ('class/user_posts.php');
$user_posts = new user_posts;
$slug = "post";
$svs = $user_posts->select(" where A.type='" . $slug . "' ", "", "0", "$postcount");
$blogArray = array();
if (mysql_num_rows($svs) != 0) {
while ($row = mysql_fetch_array($svs)) {
$blogArray[] = $row;
}
}
?>
<div class="center margin-bottom-lg">
<div class="container">
<div class="row padding-bottom-lg">
<div class="col-md-12">
<div class="gray-box">
<h1 class="header">
<?php echo $user_options->getvalue('blogtitle', 'Blog...'); ?>
</h1>
<div class="row our-services margin-bottom-lg padding-lg">
<?php
header('Cotent-type: text/plain'); // Just here for formatting
foreach ($blogArray as $array) {
echo '<div class="col-md-4">';
echo '<div class="row">';
echo '<div class="col-xs-12">';
echo '<a class="title-link" href="#">';
echo '<h3>' . $array['slug'] . '</h3>';
echo '</a>';
echo '<p>' . $array['description'] . '</p>';
echo '<p class=""><a href="#" class="btn-link">Read More...</a></p>';
echo '</div>';
echo '</div>';
echo '</div>';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>