Skip Navigation

[Resolved] Pagination is not appearing on a view

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 0 replies, has 1 voice.

Last updated by Saul Baizman 4 weeks ago.

Assisted by: Minesh.

Author
Posts
#2785072

Hi there,

I've created a view with a custom search and enabled pagination. (This view uses the legacy Classic Editor.) The "[wpv-pagination]" shortcode is added to the "Search and Pagination" area, but no pagination appears. (12 items are supposed to be displayed initially, but there are over 200, and so pagination ought to appear.)

I've been using Toolset for around 7 years, so I don't think I'm doing anything wrong. Can I provide credentials to my website in order for you to investigate?

Thank you.

Saul

#2785220

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please send me screenshot of your edit view page?

In addition to that - Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

#2785614

Minesh
Supporter

Languages: English (English )

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

I just created the following test view:
- hidden link

And I display this test view on the following page:
- hidden link

I can see pagination is displaying without any issue.

It looks like either due to customizations you done with the view or somehow that view's pagination is broken. Standard view works just fine and it displays the pagination without any issues.

#2785672

Hi Minesh,

Thanks for your response. I do indeed see the pagination in that test view. The issue is that pagination is not appearing in a specific view of mine. Here's the URL in the dashboard:

hidden link

Here's a URL where the view is publicly visible:

hidden link

Can you investigate that?

Thank you.

Saul

#2785722

Minesh
Supporter

Languages: English (English )

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

It could be possible that view is broken somehow, what if you try to create a new view and check if that help you to resolve your issue.

#2785845

Minesh,

Thanks for your response. I'll give that a try.

I suspect the pagination is failing because I'm nesting the [wpv-control] shortcode in a custom shortcode ([la_wpv_control_post_type]); while it's rendering the front-end filter correctly, the pagination is breaking.

The only reason I'm doing that is because I need to modify the default HTML output of the [wpv-control] shortcode. Might there be another way to accomplish this? Is there a PHP hook / filter that would allow me to modify the HTML without resorting to this weird nested shortcode work-around?

Thanks.

Saul

#2785959

Minesh
Supporter

Languages: English (English )

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

Here is the Doc that shows all filters that you can use to filter view's output:
- https://toolset.com/documentation/programmer-reference/views-filters/

But there is no such feature available to change the shortcode output.

What exactly you want to change while you using normal shortcode output?

#2785973
screenshot 2024-11-27 at 08.45.37.png

Minesh,

Thanks for your response.

In terms of what HTML output I want to change, when creating front-end filters, there appear to be differences when creating a filter based on a taxonomy and based on a post type. Simply put, the HTML differs very slightly, but enough to make it impossible for me to use identical CSS to style the two filters.

I don't have time at the moment to illustrate all of the differences between them, but the HTML output for taxonomies wraps each label element and input element in a parent div element with a class of "radio." This makes them very easy to re-arrange in a CSS grid. The HTML output for a front-end filter based on a post type doesn't do this, and it adds br elements. This makes them impossible to re-arrange via a CSS grid. My custom shortcode makes the output of the post type taxonomy filter resemble the output of the post type filter.

Attached is a screenshot that shows how the output is being manipulated. Most of the action happens on line 156.

Saul

#2786013

Minesh,

I tried to recreate the view and realized that I couldn't—because the view code had been written by you in this forum post:

https://toolset.com/forums/topic/filter-a-list-of-posts-based-on-taxonomy-and-post-type/

I did try removing my custom shortcode and using the proper [wpv-control] shortcodes in the "Search and Pagination" area, but this didn't work.

Based on all of this, it appears that the custom code you provided does not display pagination. I've re-created a view that filters a set of posts by post type here:

hidden link

The view is configured to display 12 posts, but there are 200+, therefore pagination should appear. (The [wpv-pager-nav-links] shortcode appears on line 8 in the Loop Editor of the view.)

The view can be seen on the public face of the site here:

hidden link

Would you kindly take another look at the view configuration?

Saul

PS. The login credentials posted on this thread on 2024.11.22 are still valid.

#2786047

Minesh
Supporter

Languages: English (English )

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

Please check now: hidden link

When I checked the view and checked the pagination settings the pagination settings were set to "No pagination" and I've set the pagination setting to "Pagination enabled with manual transition and page reload" and I can see the pagination now.

#2786141

Minesh,

After an exhaustive look at the issue, the cause was a ridiculously basic one. The problem was that the view was only retrieving 12 posts, and pagination was set to 12 posts per page—which means no pagination was necessary!

I apologize for dragging this out so long, and I thank you again for your patience and assistance.

Saul