Skip Navigation

[Resolved] Where to add filter code

This support ticket is created 5 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 5 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#1201273

Lee

Tell us what you are trying to do? Add a filter

Is there any documentation that you are following?
https://toolset.com/forums/topic/displaying-more-than-50-posts-in-a-view/

Is there a similar example that we can see?
https://toolset.com/forums/topic/displaying-more-than-50-posts-in-a-view/

I'm wanting to exactly this, but do not know where I am supposed to paste the code in the above example. Does it go in the view or???

#1201278

I don't follow the logic of that Ticket's Summary of the resolution:
"Problem: I would like to display more than 50 results in an unpaginated View."

If a view is not paginated, it will, of course, display all posts, and if you have 56 posts, it would display 56.
If you have 10, then 10.
I also see that code sets the posts per page (so it is indeed a paginated View!) to the extremely huge amount of 67890 (!!) posts per page.
This will probably kill the website as it will underperform in the query. WordPress cannot list that many posts for several users (potential visitors) at once.
Views use just the WordPress query, so we are bound to it.

Clearly, following the threads' origins, this code is made to actually make Views with pagination, not unpaginated as described in the ticket's summary.
I have updated Christian to please adjust that.
The original thread is here:
https://toolset.com/forums/topic/make-more-than-50-posts-show-on-paginated-view/

The correct thing to do here is to add a feature request here https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/, asking to actually allow manual input on the pagination (items per page) settings. Then, you can add manually a number there, be it 1, 100 or 10k, and are not bound to the Selector as it's offered now.

Now, if you want to have this working now since the feature (if you are going to request it) will take a longer time to be implemented, then yes you need that Custom Code.

The Custom codes generally are added to the Theme's functions.php file, or, in Toolset > Settings > Custom Code (last tab) you can add it directly within our plugins - it's a lot safer because we check the code before applying it automatically, so you can avoid fatal errors 😉

Hope I could be of any help with this and that the details above clarify the task!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.