Hi, I've a Block View with search filters and pagination.
I'd like to remove pagination on search submit, I need to display all the results on the same page, not paginated. But I still want pagination when results are not filtered.
Is it possible?
I've also another issue with the same view. I'm displaying publish, draft and pending posts, but when I run a search, the view displays only publish posts in the result. Is it possible to include all the posts?
Hello. Thank you for contacting the Toolset support.
You should try to use the view's hook "wpv_filter_query" to change the posts_per_page and increase the limit of it based on any URL param available when you do the search.
To hide the pagination links, you should wrap the pagination section with conditional block and use the shortcode [wpv-search-term param='any-param'] to see if the URL param exists or not and based on that you should display the pagination section.
For example, please check the following screenshot: hidden link
- The pagination will display if URL param search is equal to empty.
Thank you, I will try this solution. I also mentioned another issue:
I've also another issue with the same view. I'm displaying publish, draft and pending posts, but when I run a search, the view displays only publish posts in the result. Is it possible to include all the posts?
What if you try to add a query filter from the "Content Selection" tab of your view and add a post status filter. Please check the following screenshot: hidden link