Toggle Bar Search [Pro]

Knowledgebase Docs » ShiftNav » Shortcodes
USEFUL? 10

Since version 1.1

To add a drop-down search box to your main toggle bar, add this shortcode to the Toggle Content Right Edge or Toggle Content Left Edge box under the ShiftNav Settings > Toggle Bar

Shortcode

[shiftnav-search-toggle]

Setting

Result

Searching for a specific post type

since v1.5

The search bar is simply a form that submits your search string to the WordPress core search system. The search results are gathered by WordPress, and displayed by your theme. So this shortcode is responsible only for the search form itself, not the results or their display.

If you would like to limit the type of posts that will be searched, however, you can do so by setting the post_type attribute in the shortcode.

For example, if you only want to search for a custom post type “product”, you could use the shortcode

[shiftnav-search-toggle post_type="product"]

This restriction will be submitted with the form, and WordPress will then only return posts that are products.