We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31ef8ca commit cbc7db9Copy full SHA for cbc7db9
1 file changed
src/hooks/custom-query-filter.md
@@ -131,6 +131,23 @@ function my_query_by_post_status( $query ) {
131
add_action( 'elementor/query/{$query_id}', 'my_query_by_post_status' );
132
```
133
134
+### Increase the Number of Posts in a Posts Widget
135
+
136
+Use the following to change the number of displayed posts in a posts widget:
137
138
+```php
139
+/**
140
+ * Update the query to set how mamy posts to display.
141
+ *
142
+ * @since 1.0.0
143
+ * @param \WP_Query $query The WordPress query instance.
144
+ */
145
+function my_query_posts_per_page( $query ) {
146
+ $query->set( 'posts_per_page', 20 );
147
+}
148
+add_action( 'elementor/query/{$query_id}', 'my_query_posts_per_page' );
149
+```
150
151
## Notes
152
153
You may need to refresh the [editor](./../editor/) to see the filter's effect.
0 commit comments