Many of our clients use WordPress as the platform for their main company websites. When building landing pages and blogs etc on HubSpot, one challenge we have consistently faced is navigation - specifically that the menus have to be maintained in two places - in a HubSpot coded file (include) and also on WordPress.
Hence, we have started using the WordPress API to grab the menu items from the main site and build the menu in HubSpot dynamically. Landing pages that we have created are on subdomains of the main domain where the WordPress install resides, so cross origin requests are not needed.
All works OK 90% of the time, but we have intermittent issues where the request to the WordPress API is rejected based on the value of the Access-Control-Allow-Origin header being sent as http://preview.hs-sites.com rather than the landing page URL. As I said, it’s not all the time - but when it does happen the user viewing the page has no navigation! Obviously we can have a fallback where we use some static code, but I’d like to understand how/why this is happening.
For clarity, these are LIVE landing pages, not being previewed or using any preview links.
Thanks in advance.