Hi,
my question seems trivial but it’s not clear to me if we can use, in our custom templates overrides, the ID of a page instead of the slug. It’s not so clear in the docs, that states:
The theme root contains files that you can further extend with the normal WordPress Template Hierarchy
Let me explain better: for example I have a page named About with id 4. I want to create a custom base.php for it. I can create base-page-about.php but it’s possible to use base-page-4.php?
This could prevent from breaking everything if the slug or the permalink change.
In my experience, the ID is less ideal than the page name or slug. The ID is essentially random, it would make future troubleshooting more difficult than simply searching for page names or slugs.
However, Wordpress should recognize the ID when looking for templates. See the hierarchy here:
Well, I understand your point, on the other side the ID is univocal so it preserves from beak everything apart when you change slug and so.
My question is relative to the way Sage implements wordpress template hierarchy and so, if the example expressed above is valid.
Thank you
Hi @benword thank you for your reply.
Indeed, I’m just asking, underlying the doubts I had reading the docs. Of course the trial and error path is always a good one