WordPress.org

Ready to get started?Download WordPress

Forums

Adding a wordpress menu in my child theme functions.php (1 post)

  1. andersedvardsen
    Member
    Posted 1 year ago #

    Hello.

    I wish to add a couple of menus to my WordPress menu system. to do this, changes need to be made to the functions.php, but i would like to do this in a child theme so that future updates will not be a problem. I know how the wordpress codex say we should treat functions.php in a child theme, but i can't seem to do it right. This is the code in the theme functions.php

    function register_main_menus() {
    	register_nav_menus(
    		array(
    			'primary-menu' => __( 'Primary Menu' ),
    			'secondary-menu' => __( 'Secondary Menu' ),
    			'footer-menu' => __( 'Footer Menu' )
    		)
    	);
    }
    if (function_exists('register_nav_menus')) add_action( 'init', 'register_main_menus' );

    Say i for exaple would like to add a specific category menu to the wordpress menu system by adding this in the function:

    'category-menu' => __( 'Category Menu' ),

    How would the code to do this look in the child theme functions.php?

    Anders

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by andersedvardsen
  • This topic is not resolved
  • WordPress version: 3.4.2