WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding fixed items to menu in template (6 posts)

  1. xrun
    Member
    Posted 2 years ago #

    Hi.
    I'd like to hardcode a couple of fixed menu selections to the main menu in the Twentyeleven theme. They need to be inserted in the theme template file, so they are visible on all blogs created by users in a network blog setup, and can be changed/added/removed across the entire network by editing the header.php file. This means I can not use the menu editor in the control panel for this, cause that'll just affect the current blog.

    The standard main menu is called in header.php like this:
    <?php wp_nav_menu( array( 'theme_location' => 'primary' )); ?>

    I'd first of all like to add a feedback link like this one:
    <a href="http://sitename.com/feedback" title="Gi feedback">Feedback</a>)

    The thing is, if I just add this link below on the next line, it'll not be shown in the main menu on the site. It'll not even behave like a normal menu item with text and background colors inverted on mouseover.
    So I need some assistance to get this link into the menu properly.

  2. stvwlf
    Member
    Posted 2 years ago #

  3. xrun
    Member
    Posted 2 years ago #

    Yes, that's a thorough code example but I don't see exactly where all that code is supposed to go in the theme files. I'm confused about the main differences between the theme code and the custom code in the example, and where it is placed.

  4. mr49online
    Member
    Posted 2 years ago #

    Hi, xrun!
    Please, checkout this
    link.
    Hope you got the solution.

  5. xrun
    Member
    Posted 2 years ago #

    Hi mr49online.
    Yes, this made it a bit clearer. The idea was to add some fixed items to the menu across all blogs new and old, with an existing menu already in place. This cleared it up a bit for me, thank you.

  6. mr49online
    Member
    Posted 2 years ago #

    @xrun.... that's goood ... .. :)
    and you welcome....

Topic Closed

This topic has been closed to new replies.

About this Topic