wordpress/twentynineteen-child/functions.php
/**
 * Filters nav urls so they are relative paths for Gatsby
 */
Filters nav urls so they are relative paths for Gatsby
Filters nav urls so they are relative paths for Gatsby
function filter_nav_menu_items($menu) {
    $site_url = get_site_url()."/";
    $current_url = $menu->url; 
    $new_url = str_replace($site_url, '/', $current_url); 
    $menu->url = $new_url; 
    return $menu; 
}
function filter_nav_menu_items ( $ menu ) { $ site_url = get_site_url ( ) . " / " ; $ current_url = $ menu -> url ; $ new_url = str_replace ( $ site_url , '/' , $ current_url ) ; $ menu -> url = $ new_url ; return $ menu ; }
Filters nav urls so they are relative paths for Gatsby
Filters nav urls so they are relative paths for Gatsby
//grab the current url link //replace the base url with a '/' //save the new url to the <code>url</code> property in the menu item object //return the filtered object