• 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

Search form inside primary menu

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 › Search form inside primary menu

This topic is: resolved
  • This topic has 3 replies, 2 voices, and was last updated 6 years, 5 months ago by AnitaC.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 19, 2020 at 8:50 am #498060
    Fabio Nodari
    Participant

    Hi guys,

    I want to hide the search form in the left-header. I did it by using the display:none rule but is there a way to actually remove it via php code?

    Then I want to add the search form inside the primary menu. I found some way to do it but it's really difficult to change the style of the input form. I'd be happy to have the same style applied to the search form in the left-header.

    Any way to do it?

    The code I found is this:

    function custom_menu_extras( $menu, $args ) {
    if ( 'primary' !== $args->theme_location ) {
    return $menu;
    }
    $menu .= '<li class="menu-item">' . get_search_form( false ) . '';
    return $menu;
    }

    add_filter( 'genesis_markup_search-form-submit_open', 'custom_search_form_submit' );
    function custom_search_form_submit() {
    $search_button_text = apply_filters( 'genesis_search_button_text', esc_attr__( 'Search', 'genesis' ) );
    return sprintf( '', $searchicon, $search_button_text );

    But I can't find a way to change the color of the text inside the input field.

    Thanks


    My Blog | My Instagram

    https://www.fabionodariphoto.com/en/
    April 19, 2020 at 9:14 am #498061
    AnitaC
    Keymaster

    @nfabiox85 I added the snippet you can use to a short blog post here.

    Give that a try.


    Need help with customization or troubleshooting? Reach out to me.

    April 20, 2020 at 9:04 am #498081
    Fabio Nodari
    Participant

    Brilliant! Thanks Anita.


    My Blog | My Instagram

    April 20, 2020 at 11:04 am #498082
    AnitaC
    Keymaster

    You're welcome.


    Need help with customization or troubleshooting? Reach out to me.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Search form inside primary menu’ 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