Sometimes you find a WordPress theme you love, like Twenty Nineteen, but it’s just missing something you really want, like a search bar at the top. I’ve covered my other Twenty Nineteen tweaks in an earlier post, but folks have asked about this too. Since it works for pretty much any theme, I figured a separate post would be more appropriate.
Since you don’t have a search bar in at the top of your site, you’re probably using WordPress’s built-in Search widget. The first thing you’ll want to do is right-click the widget’s title, choose Inspect Element (or similar, it depends on your browser) and copy its section ID. In my case, that is:
<section id="search-3" class="widget widget_search">
so, the section ID is search-3.
Now, edit your site’s menu. Here you’ll add a Custom Link to your menu, enter only # followed by the section ID as the URL, in my case #search-3 and enter whatever you’d like for the Navigation Label. I went with a magnifying glass emoji 🔍 , and if you choose an emoji too, please enter “Search” in the Title Attribute field so folks with Screen Readers know what the link is for.