[wp-hackers] Posts 2 Posts: Pagination for connected posts on single post template
Md Mahmudur Rahman
iammahmudur at gmail.com
Fri Jun 28 00:36:43 UTC 2013
This is now working. I have changed the arguments for my second query as
// Find connected posts
$connected = new WP_Query( array(
'connected_type' => 'artists_to_posts',
'connected_items' => get_queried_object(),
'paged' => (get_query_var('page')) ? get_query_var('page') : 1,
Thanks for your help.
On Fri, Jun 28, 2013 at 10:24 AM, Md Mahmudur Rahman
<iammahmudur at gmail.com>wrote:
> If I set the page number as a GET parameter then it works for the first
> loop/primary loop and not for the secondary loop. As a result the URL
> Here is the response (WP_Query Object) for the first loop:
> And here is the response (WP_Query Object) for the second loop:
> How can I set the 'page' parameter for the second loop?
> Many thanks.
> On Fri, Jun 28, 2013 at 9:57 AM, J.D. Grimes <jdg at codesymphony.co> wrote:
>> Does it work if you add the page number as a GET parameter?
>> For Example, http://localhost/artist/artist-name/?page=2
>> -J.D. Grimes
>> On Jun 27, 2013, at 7:37 PM, Md Mahmudur Rahman <iammahmudur at gmail.com>
>> > Hi
>> > I have tried that as well. But no luck.
>> > The pagination links are part of a secondary loop on a single page
>> > template. And I can see that get_query_var('paged') always returning 1.
>> > a result the pagination links are not working.
>> > Is it possible to paginate through a secondary loop on a *single page
>> > template*? For example, on a single page template can I have a URL like
>> > below:
>> > http://localhost/artist/artist-name/page/2
>> > Here is the link for:
>> > single-artist.php <
>> > loop-artist.php <
>> > Pagination code on functions.php<
>> > Many thanks.
>> > On Thu, Jun 27, 2013 at 11:38 PM, J.D. Grimes <jdg at codesymphony.co>
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
> *Many thanks*
> *Md Mahmudur Rahman*
*Md Mahmudur Rahman*
More information about the wp-hackers