Skip to main content
added 29 characters in body
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'main-menu' === $args -> theme_location){
 &&      if (! isset( $args['show_home'] ) )
          $args['show_home'] = _x( 'Home', 'homepage' );
   }
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'main-menu' === $args -> theme_location && ! isset( $args['show_home'] ) )
      $args['show_home'] = _x( 'Home', 'homepage' );
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'main-menu' === $args -> theme_location){
       if (! isset( $args['show_home'] ) )
          $args['show_home'] = _x( 'Home', 'homepage' );
   }
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

added 2 characters in body
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'primary''main-menu' === $args -> theme_location && ! isset( $args['show_home'] ) )
      $args['show_home'] = _x( 'Home', 'homepage' );
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'primary' === $args -> theme_location && ! isset( $args['show_home'] ) )
      $args['show_home'] = _x( 'Home', 'homepage' );
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'main-menu' === $args -> theme_location && ! isset( $args['show_home'] ) )
      $args['show_home'] = _x( 'Home', 'homepage' );
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

Add condition
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'primary' === $args -> theme_location && ! isset( $args['show_home'] ) )
      $args['show_home'] = _x( 'Home', 'homepage' );
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( ! isset( $args['show_home'] ) )
      $args['show_home'] = _x( 'Home', 'homepage' );
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args

function wpse01_home_link( $args ) {
   if ( 'primary' === $args -> theme_location && ! isset( $args['show_home'] ) )
      $args['show_home'] = _x( 'Home', 'homepage' );
   return $args;
}

add_filter( 'wp_page_menu_args', 'wpse01_home_link' );

You can just rename Home to suite your needs

Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209
Loading