Calling wordpress menu outside ignores custom menu item

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/])

Topic outside-wordpress menus Wordpress

Category Web


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.