We have dev and test environments that are only accessible from the internal company network but our WP installations (only part of the whole domain) are hosted on Amazon Web Services. I have need for the server to retrieve the contents of our header/footer anytime an update is made to menus etc. I have created an /update/ page and want to retrieve the contents of this page on menu update using either

$html_content = file_get_contents(get_bloginfo(‘wpurl’).’/update/’ );


$html_content = wp_remote_fopen(get_bloginfo(‘wpurl’).’/update/’ );

but our wpurl in dev and test is set to an intranet url which is not accessible from the server at AWS.

My question is this: Is there a WP function that can retrieve the full HTML of a page ID without doing an HTTP request?

Read more here: Is there a function like wp_remote_fopen that takes a post/page ID instead of a URI?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: