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.)
/en
? Is it a plugin? A parent page? A different WordPress install?{page-structure}
it's going to be very difficult to know how to answer this question, especially with the/en/
thing, is that a multilingual plugin? A parent page? How will you know which page it is you want? slug? ID? Please edit your question with more context/details