Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Starkers Theme and Custom menu wordpress

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #144226
    Attila Hajzer
    Participant

    How do i implement the custom menu in starkers theme on my website hajzer.info.

    I’ve created my menu and named it Navigation and set it as primary menu.

    ive found on other installs on wordpress that in the header file they have

    <?php get_template_part( ‘primary’, ‘menu’ ); ?>

    but that didn’t seem to work for me. so i’m not sure what to do next.

    #144329
    Alen
    Participant

    Starkers team [wrote their own](https://github.com/viewportindustries/starkers/blob/master/external/starkers-utilities.php#L41) get_template_parts (notice the “s”) function to output parts of template by supplying the function with an array.

    get_template_part() loads a file that is located in your theme directory. The code you posted is telling wordpress: go to theme directory and look for primary.php and menu.php file.

    Now the code [you need is in the](https://github.com/viewportindustries/starkers/blob/master/functions.php#L30) functions.php file.

    Here is a quick breakdown how to activate the menu:

    In your functions.php

    register_nav_menus(
    array(
    ‘header’ => __(‘Top Menu’),
    ‘footer’ => __(‘Bottom Menu’)
    )
    );

    Then go to WP Admin, Appearance >> Menus and create your menus.

    To call them in your theme use this:

    <?php wp_nav_menu(array(‘theme_location’ => ‘header’)); ?>

    and/or

    <?php wp_nav_menu(array(‘theme_location’ => ‘footer’));?>

    You can have one or many, and you can name them whatever you like. As long as you are selecting appropriate menus from theme location dropbox you should be good.

    Hope that helps,
    -Alen

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.