Skip to content

Knowledgebase

Filtering a Query Loop by category and author

wordpress

Query Loop filters create a focused collection, such as tutorials written by one editorial team member. Set the criteria on the parent query and verify the actual results rather than assuming a visually correct layout contains the right posts.

01 Prepare representative content

Identify a few posts that should match and a few that should not. Confirm their categories, authors and publication states in the post list. A misspelled or unused category cannot produce the intended collection, and an author filter may refer to the post's assigned author rather than the person who last edited it.

02 Apply the filters

  1. Open the page or template and select the Query Loop itself in List View.
  2. Review whether it inherits the template query. For an independent curated list, use the custom-query mode available in the block settings.
  3. Choose the intended content type and add the available category and author filters.
  4. Review sorting and item count so a matching post is not merely hidden on a later results page.
  5. Save a draft and compare the output with the representative posts you identified.

How do category and author filters work together?

Multiple filters can narrow results more than expected. Test them one at a time when diagnosing an empty list, and document the intended rule in your editorial notes. Do not remove a filter permanently simply because it makes the preview look fuller.

The available controls depend on WordPress, the content type and any query-block extensions. If a required relationship is not supported in the interface, use a documented extension or developer implementation instead of pretending a different filter is equivalent.

03 Verify ongoing behaviour

Publish or update a controlled matching post and confirm that the list reflects the change after relevant caches are cleared. Check that reassignment of a category or author produces the expected inclusion or exclusion.

If a template archive should follow the visitor's current category, an inherited query may be the appropriate choice instead of a hardcoded category filter. Keep that distinction clear so all category pages do not accidentally display the same collection. Review the public URL and page context whenever a query behaves differently from the editor preview.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support

Powered by WHMCompleteSolution