Skip to content

Header Search Icon Shortcode

In this article

    The header_search_icon shortcode can be used to display the search icon in your header aside field when using a supported header style.

    Technically the shortcode can be used anywhere, but it’s intended primarily for adding a search icon to your header that is separate from the main menu.

    Avoid Duplicate Search Icons

    By default, the theme automatically adds the search icon to the far right of the header menu. If you’re also using the header_search_icon shortcode, this can result in two search icons appearing. To fix this, go to Customize > Header > Search and disable the Menu Icon option.

    Sample Shortcode Usage

    [header_search_icon]

    Shortcode Attributes:

    Below are the attributes accepted by the header_search_icon shortcode:

    AttributeDescriptionDefault
    classcustom classes to add to the element
    label_classcustom classes to add to the label
    button_classcustom classes to add to the button
    icon_classcustom classes to add to the icon –
    visibilitycustom visibility –
    labelcustom label
    label_marginlabel margin10px
    label_positionlabel position (right or left)right
    label_hide_breakpointbreakpoint to hide the label on smaller screens (sm,md,lg,xl)
    aria_labelcustom aria label attribute for accessibilitySearch
    Related Articles
    Back To Top