block editor - wp:query not responding to new settings

admin2025-01-07  4

I'm using the block code editor to get more results per page by adjusting the perPage and title settings. However, it is does not seem to respond to my new settings:

<!-- wp:query {"queryId":73,"query":{"perPage":100,"pages":1,"offset":"0","postType":"spice","order":"asc","orderBy":"title","author":"","search":"","exclude":[],"sticky":"","inherit":true,"parents":[],"format":[]},"align":"wide","layout":{"type":"default"}} -->

For example, I know that I have 30 custom post entries for the word "yellow" when I search directly in the wp-admin area. However, when I run the search results from the published site, the search results only outputs 10 entries, and is also not sorting by title.

Are there any nuances I should know about the new block editor that might be producing these type of results?

I'm using the block code editor to get more results per page by adjusting the perPage and title settings. However, it is does not seem to respond to my new settings:

<!-- wp:query {"queryId":73,"query":{"perPage":100,"pages":1,"offset":"0","postType":"spice","order":"asc","orderBy":"title","author":"","search":"","exclude":[],"sticky":"","inherit":true,"parents":[],"format":[]},"align":"wide","layout":{"type":"default"}} -->

For example, I know that I have 30 custom post entries for the word "yellow" when I search directly in the wp-admin area. However, when I run the search results from the published site, the search results only outputs 10 entries, and is also not sorting by title.

Are there any nuances I should know about the new block editor that might be producing these type of results?

Share Improve this question asked Jan 2 at 20:42 Marc PMarc P 5351 gold badge5 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

In the block query settings, it has "inherit":true. This means the rest of the parameters are ignored and instead the global query is used.

You could consider setting inherit to false, or otherwise use filter hooks to change the query as needed, such as pre_get_posts.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736253563a133.html

最新回复(0)