web_fsearch_sort Shortcode
The web_fsearch_sort shortcode renders a sort selector for faceted-search results.
Usage
[web_fsearch_sort]
[web_fsearch_sort context="your_context" label="Order results" options="date_desc:Newest,title_asc:Title A-Z" default="date_desc"]
Attributes
| Attribute | Default | Accepted values | Purpose |
|---|---|---|---|
context |
Empty | Enabled context ID | Empty follows the current results context. Missing or disabled explicit contexts render nothing. |
class |
Empty | Space-separated classes | Existing theme helpers on the normal wrapper. |
label |
Empty | Plain text | Visible and accessible select name; empty uses translated Sort by. |
options |
Empty | Comma-separated key:Label entries |
Ordered subset, up to 100 entries. Omit labels to follow current translated labels; empty uses automatic choices. |
default |
default |
Available sort key | The first matching selector supplies the page default; explicit URL state wins. |
Faceted search context
Enable and configure Faceted Search in Settings → POM Theme → Content model → Faceted search. Controls, results, and gateways that belong together must use compatible context values.
General keys: default, date_asc, date_desc, title_asc, title_desc, modified_asc, modified_desc, comment_count_asc, comment_count_desc, menu_order_asc, menu_order_desc and rand.
Product contexts with WooCommerce can also use price_asc, price_desc, rating_asc and rating_desc. A configured proximity facet exposes distance_asc and distance_desc; ordering requires an active location. A context custom-field rule with ID priority exposes meta_priority_asc and meta_priority_desc. Only configured rules are accepted; the control does not accept arbitrary field keys.
The automatic list includes default, publication date, title and applicable product, proximity and custom-field choices. Custom lists preserve their order. Invalid choices are omitted. A missing configured default is inserted into the list; an unavailable default falls back to default. A valid current request choice is displayed even when it is outside a selector's subset.
Use one interactive context per page. Multiple controls retain their own options and labels, while sharing the selected order. Changes reset pagination. Reset only changes the order when its extra-control reset option is enabled. No selector-specific frontend bundle is added, and Page Builder administration may remain disabled.
Test every option with enough records to reveal the order, plus an active filter, pagination, URL restoration, and browser back/forward navigation. If an option appears to do nothing, verify its key and indexed data rather than adding a second sort control.
Verification
Test web_fsearch_sort with the configured Faceted Search context, active selections, no selections and an empty result set. Pay particular attention to class and label.
For native authoring, use Faceted Search Sort in Gutenberg.