publish;
// Posts per page
$per_page = 9;
// Determine total amount of pages
$total_pages = ceil($numposts / $per_page);
// Get current page
$paged = (get_query_var( 'page' )) ? get_query_var( 'page' ) : 1;
// Above your loop
$ignores = array();
// If we have sent ignore ID's
if ( $_GET['ignore'] )
{
$get_ignores = trim($_GET['ignore'], ',');
$get_ignores = explode(',', $get_ignores);
}
// If we have ignore ID's
if ( !empty($get_ignores) )
{
foreach ($get_ignores AS $k => $v)
{
$ignores[] = $v;
}
}
$count = 1;
$my_args = array(
'posts_per_page' => 9,
'paged' => get_query_var( 'page' ),
'post__not_in' => $ignores,
'post_status' => 'publish'
);
$my_query = new WP_Query($my_args);
if ( $paged <= $total_pages):
$paged = $paged + 1;
// The loop
while ( $my_query->have_posts() ): $my_query->the_post();
// At the start of the loop populate the used post ID's
$ignores[] = $post->ID;
?>
$v ) {
$ignore_str .= $v.',';
}
// Trim the ignore string of any rogue commas
$ignore_str = ltrim($ignore_str, ',');
$ignore_str = rtrim($ignore_str, ',');
$ignore = site_url('page/'.$paged.'/?ignore='.$ignore_str.'');
}
?>
Load More Posts
have_posts() ) : ?>
Saturday, 24 March 2018
Tags
# automatic news
About sahil sondarava
Soratemplates is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design. The main mission of templatesyard is to provide the best quality blogger templates.
automatic news
Labels:
automatic news
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment