Tuesday, 3 September 2013

To link the next with my widget paginate link

To link the next with my widget paginate link

I have created a paginate of posts in my widget. In that i want to display
6 posts title and after that when user click on the next paginate number
it will display the other 6 posts. But in the content page. It is not
changing now.I want to display the 6 posts in my widget and also in the
content area. When user click on the next button or pagination number it
will display the next posts in the widget and also in the content area.
To paginate in the widget area i wrote the bellow.
global $wp_query;
$pages = $wp_query->max_num_pages;
wp_reset_query();
?>
</li>
<div class="pagination">
<?php
$big = 999999999; // need an unlikely integer
$path= get_site_url().$_SERVER['REQUEST_URI'];
$url = substr($wrong, 0, strpos($path, '?'));
echo paginate_links( array(
'base' => $url.'?cpage=%#%',
'current' => $paged,
'total' => $pages,
'show_all' => False,
'end_size' => 2,
'mid_size' => 1,
'prev_text' => __('&laquo;'),
'next_text' => __('&raquo;')
) );
?>
How can i display the 6 posts in the widget area and also in the content
area when a click the paginate number.

No comments:

Post a Comment