0

I have a wordpress website and I want to use wordpress menu outside the installation.

So I created a file called nav.php and put the following code

  include( '../wp-load.php' ); 
  wp_nav_menu( array( 'theme_location' => 'primary','menu_id' =>   'cartel' ) ); 

In the header on another website,

<?php echo file_get_contents('http://example.com/nav.php') ?> 

This ignores the menu item having custom link created in the WordPress menu. Please help. for example (SHOP [/shop/])

1 Answer 1

0

You can not use WordPress functions outside your wordpress dir (wordpress core). Wordpress is a framework and you need to create pages based on the guidelines set by WP community.

You need to create a proper WP page and than maybe use it on the other domain with iframe.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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