Starting in 4.7 using REST API – This is JumpStart specific.
On “host” site:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 | function get_menu() { # Change 'menu' to your own navigation slug. return wp_nav_menu(themeblvd_get_wp_nav_menu_args('primary')); } //https://hosturl.com/wp-json/myroutes/menu add_action('rest_api_init', function () { register_rest_route('myroutes', '/menu', array( 'methods' => 'GET', 'callback' => 'get_menu', )); }); |
On “receiving” site:
0 1 2 3 4 5 6 7 8 9 10 | function jma_child_header_menu_addon() { $response = wp_remote_get('https://hosturl.com/wp-json/myroutes/menu'); /*echo '<pre>'; print_r($response); echo '</pre>';*/ echo str_replace('null', '', $response['body']) ; } add_action('themeblvd_header_menu_addon', 'jma_child_header_menu_addon'); |
JQuery to add current classes (coming soon):