• losrack

    (@carlos-jaramillo)


    Hi,

    I having problems trying to create a new menu, and I want to place it on the header.

    I thought I just could copy the header.php and page.php files and add code, to my child-theme folder files, but every time I do this the front end stops working.

    Am I doing something wrong here?

    How is the proper way to have header and page.php files on child folder?

    Any help would be much appreciated.

    This in detail the code I am adding to page, header and functions.php

    I am adding this to my page.php

    /**
     * new menu
     */
    <?wp_nav_menu( array( 'theme_location' => 'new-menu', 'container_class' => 'new_menu_class' ) ); ?>

    This code to my header.php

    /**
     * new menu
     */
     <?php wp_nav_menu( array( 'theme_location' => 'new-menu' ) ); ?>

    And this to my functions.php

    function register_my_menus() {
      register_nav_menus(
        array(
          'new-menu' => __( 'New Menu' ),
          'another-menu' => __( 'Another Menu' ),
          'an-extra-menu' => __( 'An Extra Menu' )
        )
      );
    }
    add_action( 'init', 'register_my_menus' );
    • This topic was modified 7 years, 7 months ago by losrack.
    • This topic was modified 7 years, 7 months ago by losrack.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘header.php and page.php on child’ is closed to new replies.