Skip Navigation

[Resolved] Paginate to previous/next brother post

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by kelvinL-2 3 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2246681

Dear Sir/Madam,

I have a custom post eBook and child post Chapter, I want to add the previous and next pagination to the current post and then I can navigate to its brother post. Is it a good practice that I create a View and limit the number of posts to 1 and then add the pagination? How can I directly jump to the nth chapter to the ebook and how do I set the filter?

I usually create a View and then insert it into the content template which is associated with the parent post (eBook), please advise how I can implement it.

Best regards,

Kelvin.

#2246849

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you shared the information that you should create a view that should display the parent post, one per page using pagination but why dont you go with the single post instead of creating the view that lists your post (one at a time using pagination). You should create a content template to display single post and attach it to your desired post type.
=> https://toolset.com/course-lesson/creating-templates-to-display-custom-posts/

If your post type's single post will will do the job, then you should create a view that lists related child posts and display all related child post on your single post.
=> https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items

Please let me know if you have other ideas or want to go with different workflow.

#2247017

Dear Minesh,

What do you mean by the single post? The single post you mean is ebook or chapter?

I know how to make a Content Template to parent post (ebook) and include the child post (chapter) by View using the filter like
Select posts in an eBook Chapters relationship that are related to the current post in the loop.

If I limit the child post as 1 with pagination, how can I visit the specific chapter by URL because the URL is linked to the parent post.

I know how to make a View with pagination and put it into a page and show the child post (chapter), I can jump to previous / next post by clicking the pagination but I have no idea how I can filter the chapter by selected parent post (ebook) using the URL parameter. As the URL is the page, how can I directly visit the specific child post?

If I make the Content Template to the child post (chapter), how can add the link to link with the brother post which belongs to the same parent? How can I get the previous and next brother's post?

#2248645

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What do you mean by the single post? The single post you mean is ebook or chapter?
==>
The single post of ebook post type.

So, when we display the single post of ebook post type, we can list all the related child posts (chapter) on the single post of ebook.a

if you can tell me what exactly you want to display on what post/pate and send me problem URL and admin access details, once I review your current setting and requirement you share I'll be able to guide you in the right direction.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2251995

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

So, on this single ebook page we are listing now all related chapters belongs to that single book "livingblessingseveryday-trial":
=> hidden link

We display the chapters as link so user can click on the specific chapter link.

Do you want to add pagination there? You mean we should display one chapter at a time?

#2252371
Screenshot 2021-12-25 at 9.17.49 AM.png
Screenshot 2021-12-25 at 9.03.21 AM.png

Dear Minesh,

Not adding pagination to single ebook page, from current setting, I can click to individual chapter from single ebook page but there is no pagination in single chapter page, I don't know how to add the pagination which I can jump to previous or next chapter.

For example, I click chapter 3 from the single ebook page, it jumps to a single chapter page /chapter/1003/, I want to have the pagination in this page, and visitors can jump to chapter 2 or chapter 4, refer to my screenshot, there is a custom field "order" to each chapter post, the order is not must be same as the post id, so I can't assume the next chapter of 1003 is 1004, I have to do the Query with orders to the custom field "order" and get the previous and next post id.

If I make a View in page (hidden link), pagination is easy to be implemented but I don't know how I can build the ebook index on the single ebook page.

I check the link to chapter 1 is

<em><u>hidden link</u></em>

and chapter 2 is

<em><u>hidden link</u></em>

What is the id 7335, 7334 in above Url?

#2253519

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've change the "Loop Editor" section for the following view as given undeR:
=> hidden link

<wpv-loop>
          <li><a href="/view-chapter/?ebook-id=[wpv-post-id item='$current_page']&&wpv_view_count=7334&wpv_paged=[wpv-loop-index accumulate="false"]">[wpv-post-title]</a></li>
		</wpv-loop>

Now, when you click on any chapter it will redirect you on that chapter and also pagination is working. Can you please confirm it works as expected: hidden link

#2254813

My issue is resolved now. Thank you!