• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Primary Navigation Extras Issues

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Primary Navigation Extras Issues

This topic is: resolved

Tagged: navigation extras

  • This topic has 5 replies, 3 voices, and was last updated 8 years, 1 month ago by eknight74.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • December 14, 2017 at 12:32 pm #214561
    eknight74
    Member

    I added the Primary Navigation Extras code snippet to the functions.php file of my genesis sample child theme. After hitting update file, it said it was updated but nothing changed. When I go to menus there is nothing different. What happened.

    http://emilybknight.com
    December 14, 2017 at 3:11 pm #214565
    Victor Font
    Moderator

    After enabling the Primary Navigation Extras, did you go to the Genesis Theme Settings page and select which extra you want displayed?


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    December 15, 2017 at 4:27 am #214566
    Brad Dalton
    Participant

    I think the problem here is that you may have forgotten to uncomment the code inside the function.


    Tutorials for StudioPress Themes.

    December 15, 2017 at 8:20 am #214568
    eknight74
    Member

    @braddalton
    I copied the code from the code snippets. There was nothing on that page that said I needed to uncomment. Here is the code I have. How do I uncomment? Thanks in advance.

    add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
    /**
    * Filter menu items, appending either a search form or today's date.
    *
    * @param string $menu HTML string of list items.
    * @param stdClass $args Menu arguments.
    *
    * @return string Amended HTML string of list items.
    */
    function theme_menu_extras( $menu, $args ) {
    //* Change 'primary' to 'secondary' to add extras to the secondary navigation menu
    if ( 'primary' !== $args->theme_location )
    return $menu;
    //* Uncomment this block to add a search form to the navigation menu
    /*
    ob_start();
    get_search_form();
    $search = ob_get_clean();
    $menu .= '<li class="right search">' . $search . '';
    */
    //* Uncomment this block to add the date to the navigation menu
    /*
    $menu .= '<li class="right date">' . date_i18n( get_option( 'date_format' ) ) . '';
    */
    return $menu;
    }

    December 15, 2017 at 8:26 am #214569
    Brad Dalton
    Participant

    Remove this /*

    and this */ from within the code


    Tutorials for StudioPress Themes.

    December 15, 2017 at 8:34 am #214570
    eknight74
    Member

    Thanks @braddalton. I had just figured it out and was coming back to mark this resolved. Thanks for your help.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Primary Navigation Extras Issues’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble