-
Posted in : Efor
-
Are you able to help us regarding one simple piece of code to fix a bug in the EFOR theme we purchased on Themeforest?
We are using Elementor > Posts Widget > editing general section. We want to include more than 30 posts on different pages for articles, thought leadership, blogs, etc.
Right now, whatever number above 30 we put it reduces down to 2 digits.
180 > becomes 18
360 > becomes 30
Anything above 30 goes back to default.Are you able to help direct us what to change in functions this limit placed in the theme?
Or is something else conflicting (a plugin)?Thanks in advance for all your help.
We’ll be happy to implement any custom code to override this or can be directed.
I know with other WordPress blogs in past a theme may have limited the number of posts to protect memory.Hi,
Thanks for the clear description — that “180 → 18, 360 → 30” behaviour is the key clue. It’s not a memory-protection limit, and it isn’t corrupting your query: the Posts widget’s Posts Per Page field simply has a numeric cap on it, so any value you type gets trimmed/clamped down to a maximum of 30. That’s why you can’t enter a higher number directly in the field.
The cleanest fix is to bypass that input field entirely and set the post count from a server-side query hook. Elementor’s Posts widget supports a custom Query ID for exactly this:Edit the page in Elementor and select the Posts widget.
Open the Query section → scroll to the Query ID field (near the bottom of that section).
Enter a unique ID, e.g. more_posts
Update the page.Then add this to your child theme’s functions.php (Appearance → Theme File Editor, or via FTP):
add_action( 'elementor/query/more_posts', function( $query ) { $query->set( 'posts_per_page', 180 ); } );The 180 is the number of posts that page will display — change it as needed. If you want different limits on different pages, just give each Posts widget its own Query ID and add a matching hook. Because this sets the value server-side, the 30 cap on the input field no longer applies.
A couple of notes:Always put custom code in a child theme so it survives theme updates.
Loading 180+ posts on a single page can get heavy — if you notice it slowing down, consider enabling Elementor’s pagination or a “Load More” option instead of rendering everything at once.Thanks,
SerkanThank you so much. Implementing this now.
You’re very welcome :) Glad that did the trick!
If you can spare a minute, we’d be really grateful if you’d rate the theme on ThemeForest — your feedback boosts our motivation and helps us work harder on future updates:
https://themeforest.net/downloadsIf 180 posts ever makes a page feel sluggish, switching that widget to a “Load More” / pagination setup is the easy next step.
Thank you for your support, and good luck with the rollout!
Thanks,
Serkan
You must be logged in and have valid license to reply to this topic.