This is a rather simple question, so I'll keep it short.
Update1: In this context {page-structure}
means just that: page1/page1-1/page1-1-1/{...}
.
Update2: For further clarification, I want to do about the same the ACF Post Object field is doing, except I want to do it dynamically based on the URL structure as explained below.
I'm making a custom multilingual site, with a dual page structure (with and without /en
). Any page at mysite.com/en/{page-structure}
are getting its locale changed to en_US
and the content (ACF) is fetched from the corresponding page at mysite.com/{page-structure}
. Based on the locale different content is displayed.
How can I on mysite.com/en/{page-structure}
automatically get the $post Object from mysite.com/{page-structure}
(i.e. without en/
)?
(Currently I'm using ACF to fetch fields from the corresponding page by rewriting the field requests, but it I could change the $post Object on the fly, it would make everything a little simpler.)