Forums
Home / Theme: Deejay / remove standard menu item called “Home”
(@fabjoe)
6 years, 8 months ago
Hello,
is it possible to remove the follow standard menu item called “Home”?
if ( ! function_exists( 'deejay_menu_home' ) ) { function deejay_menu_home( $items, $args ) { if ( 'bar' === $args->theme_location ) { $new_item = array( '<li class="menu-item"><a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . esc_html__( 'Home', 'deejay' ) . '</a></li>' ); $items = preg_replace( '/<\/li>\s<li/', '</li>,<li', $items ); $array_items = explode( ',', $items ); array_splice( $array_items, 0, 0, $new_item ); $items = implode( '', $array_items ); } return $items;
(@poena)
Hi! You can override this function in your child theme, by adding a new empty function with the same name:
function deejay_menu_home() { }
This will remove the Home link.
If you have not already created a child theme, I recommend reading https://developer.wordpress.org/themes/advanced-topics/child-themes/
Thank You ! 🙂