Add Search Icon in Top Bar

This is a developer-level article. If you’re unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from our support for small changes.

Add this code to your child theme functions.php file:

// Add search icon in top bar
function prefix_add_search_icon() {
        if ( true === olympus_get_option( 'add_search_icon' ) ) {
                remove_action( 'olympus_after_navigation', 'olympus_add_search_icon', 10 );
                add_action( 'olympus_after_topbar_container_inner', 'olympus_add_search_icon' );
        }
}
add_action( 'wp', 'prefix_add_search_icon' );

You can change olympus_after_topbar_container_inner by the hook you want, to add the search icon at the end of the secondary menu, replace it with olympus_after_second_nav.

All PHP snippets should be added via a child theme’s functions.php file.

Subscribe to our newsletter

Get tips, news, gifts and exclusive promotions directly to your inbox and be the first to know about the latest updates from us. No spam, we guarantee!

Olympus

Blazingly fast, lightweight, fully responsive, SEO-ready, and 100% Vanilla JS WordPress Theme

Facebook YouTube

Our Products

Get Help

Company

Copyright © 2024 | Created with Olympus & Olympus Blocks