making posts linked outside of WordPress still use the same header and footer

You’ll either need to load in WordPress, which can be considered computationally expensive if your ‘other’ pages are also powered by another webapp (not to mention the conflicts it may bring).

If they’re just regular PHP files, you should be OK.

To load WordPress, include the file /path/to/wordpress/wp-load.php, then you’ll be able to use WordPress as you would normally, including things like get_header() and get_footer().

However, whilst perhaps not the most ‘compact’ solution, my best advice would be to create header and footer files for these other pages that replicate the HTML of your theme without WordPress-specific PHP functions, and include them instead.

error code: 523