WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a WordPress site and am adding a Shopify-hosted e-commerce section which will be hosted on their servers and accessible via a subdomain. Is there any way to mirror the WordPress Navigation for my site on another platform and (maybe the harder of the two) subdomain?

I don't intend to use Shopify's product menu at all. So I'm not looking to merge the two or anything... just an easy way to get the WP menu to display elsewhere.

share|improve this question

Here is a guide. The gist of it is that you create a template file that houses your menu and then call that file from the external website.

share|improve this answer
Good answer, but I'm pretty sure this doesn't apply to a SaaS situation like Shopify, which runs Ruby and won't let me embed PHP. Maybe through their API somehow. Have to look into it. THANKS! – binaryorganic Jun 30 '12 at 21:49

Just made a simple test that may be useful.

In my local development Multisite I put two files at the root:


Loads a WordPress menu in a static page

<TITLE>Testing Ajax/WordPress</TITLE>
<script src="http://code.jquery.com/jquery-latest.js"></script>
    jQuery(document).ready(function($) {
        $("#nav-container").load("http://brasofilo.dev/test.php", function(response, status, xhr) {
          if (status == "error") {
            var msg = "Sorry but there was an error: ";
            $("#nav-error").html(msg + xhr.status + " " + xhr.statusText);
    <div id="nav-container">Container DIV</div>
    <div id="nav-error" style="display:none">ERROR</div>


Returns a WordPress menu

define( 'WP_USE_THEMES', false );
require( './wp-load.php' );
wp_nav_menu( array( 'menu' => 'Test Menu' ) );

The file test.html was loaded from a subdomain http://test.brasofilo.dev, but the Ajax call failed to load the PHP file at the main domain http://brasofilo.dev due to Same origin policy.

To overcome this, put the following Cross-Origin Resource Sharing rule in .htaccess:

Header set Access-Control-Allow-Origin http://test.brasofilo.dev

share|improve this answer
Oh, sure, I have no idea what Ruby is, and if it can run Javascript... :/ – brasofilo Jul 23 '12 at 1:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.