Hard-coded category IDs when using full-site-editor query block
-
Hello,
I am building my first theme with the full site editor.
On the index page, I have several query blocks that show posts from specific categories. It seems that selecting queries hard-codes the category IDs into the theme template file.
We’re using GIT to handle version control and have dev, staging, and production sites. I’d very much prefer to not replicate the database across each for various reasons, and it isn’t easy to manually keep IDs in sync across them.
Specifically, in the “taxQuery” part:
<!-- wp:query {"queryId":14,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false,"taxQuery":{"category":[13,12]}},"align":"wide","layout":{"inherit":true}} -->
Is there a way to use the category slug or some other method to not have hard-coded IDs in the index.html template file?
Thank you for your help.
- The topic ‘Hard-coded category IDs when using full-site-editor query block’ is closed to new replies.