Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query loop filters removed on saving theme #734

Open
FORTE-WP opened this issue Oct 4, 2024 · 2 comments
Open

Query loop filters removed on saving theme #734

FORTE-WP opened this issue Oct 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@FORTE-WP
Copy link

FORTE-WP commented Oct 4, 2024

I have made some custom templates for single posts within a specific category. The templates also have a query loop with a filter for that same category, so visitors can easily go to the next similar post. But when I save the theme, the category filters are removed. The templates show all posts.

Steps:

  1. Create a custom template
  2. Include the query loop block
  3. In Settings, create a new search and have Post as post type.
  4. Go to the Filter section and enter a specific category taxonomy
  5. Go to the Create Block Theme section in the Site Editor. Select Save Changes to Theme.
  6. Select all items, besides ‘Localize text’ and ‘Remove Navigation Refs’ and save the changes
  7. Go to the custom template to see that the filter is removed.

WordPress: 6.6.2, Create Block Theme: 2.5.0

@sahil-gidwani
Copy link

Hey @FORTE-WP , I faced a similar issue and upon further review it seems like this was intentional.
Please refer to the code here in theme-templates.php.

@FORTE-WP
Copy link
Author

Indeed, it seems intentional. However, I believe it should be an option, similar to the nav reference. When exporting to a ZIP file, the taxonomy filter can be removed, but saving the theme should not break it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants