Shortcodes

Knowledgebase Docs » ShiftNav » Shortcodes

Shortcodes [Pro] 0

ShiftNav Pro includes several shortcodes for adding custom content to your menu. They can be placed in the Custom Content areas above and below the menu in the ShiftNav Control Panel.

View

Search 7

ShiftNav provides a search bar shortcode which you can insert into the Custom Content areas before or after the menu in your ShiftNav menu settings. [shiftnav-search] You can also set the placeholder text with the placeholder attribute [shiftnav-search placeholder=”Enter to search”] By default it is set to “Search…” Search shortcode in the menu panel 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 post_type=”product”] This restriction will be submitted with the form, and WordPress will then only return posts that are products.

View

Toggles: Shortcode 0

ShiftNav provides a shiftnav_toggle shortcode which can be used to print a toggle anywhere in your content. The target attribute is the ID of the instance which should be opened. If you want to set custom content, you can enter that in the shortcode content area

View

Toggle Bar Search [Pro] 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 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 post_type=”product”] This restriction will be submitted with the form, and WordPress will then only return posts that are products.

View