Load SEO data by manually setting post ID?
-
Hi,
I have a very specific request. I am creating a complex website, where different (non-existing, would be 404 otherwise) URLs should display the same SEO data.For example I have a page called /example which normally exists in the backend and I have set up SEO data for it.
My website however allows URLs like /info/example and /details/example (which do not really exist, I just supress the 404 and let them display the website anyway) which should display the same SEO data as for the original/parent /example page in the wp_head() call.
Is there a function or a hook I can call before get_header() is called, perhaps to alter the $wp_query and trick WP/Yoast into thinking I am actually working with the original page?
In essence, some pseudocode like yoast_get_page($id) or something like that.
Thank you in advance for your answer!
The topic ‘Load SEO data by manually setting post ID?’ is closed to new replies.