# Fix a WordPress Query Loop Showing the Wrong Posts

https://ferkesh.net/uk/baza-znan/stattia/wordpress-query-loop-inherit-vs-custom

A Query Loop inside a template can inherit the page's query. A custom query uses the block's own filters. Find the parent Query Loop block for the exact URL before editing posts or assuming they are missing.

![Public route: Identify active template; Query source: Inherited or custom; Result check: Posts and pagination.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-16.svg#wordpress-query-loop-inherit-vs-custom)

## Find the right template

Preview the public URL in an ordinary browser. Locate the active template in the Site Editor and select the outer Query Loop in List View. A category archive usually needs its current category context. A hand-picked homepage loop may need its own query. Selecting an inner Post Template changes layout rather than the list of records.

## Build a small staging fixture

Use published posts from two categories and one draft. Review post type, taxonomy, author and sort settings, then change one item and reload the affected route. Compare the observed list with the expected list for both categories.

## Check pagination and reuse

Open a category with no matches and one long enough for a second page. Check an unrelated route using the same template. Revert if a formerly distinct category now shows the same custom list everywhere.

## Related Ferkesh Knowledge Base guides

- [Why a WordPress Block Template Diff Can Be Absent on Disk](https://ferkesh.net/knowledgebase/article/wordpress-block-template-override-precedence)
- [How to Diagnose WordPress Block Styles Missing on the Public Page](https://ferkesh.net/knowledgebase/article/wordpress-block-styles-missing-public)

## Official references

- [Query Loop block — Documentation — WordPress.org](https://wordpress.org/documentation/article/query-loop-block/)

Last reviewed November 27, 2026.
