🎯 Need Help?

Get Premium Support

Priority assistance from the developer

⬆️ Upgrade

Unlock all features

More from ANWP

Sports Leagues Premium

Multi-sport league management with advanced statistics

Learn more →

AnWP SL Theme Kit

Starter themes & block patterns for Sports Leagues

Learn more →

Live Search Shortcode

Pro Feature

Add a live search widget that lets visitors quickly find teams and players. Features instant results as users type, with dropdown or inline display options. Perfect for navigation headers, sidebars, or dedicated search pages.

Premium Feature

This shortcode requires the Football Leagues Premium plugin.

Basic Usage

[anwpfl-search]

This displays a search widget for finding teams and players.

All Parameters

Parameter Default Description
search all What to search: all, teams, players
suggested (empty) Comma-separated IDs to show as suggestions before typing
layout dropdown Results display: dropdown or inline
width 250 Search input width in pixels
has_search_icon 1 Show search icon. Use 0 to hide
has_reset_icon 1 Show reset/clear icon. Use 0 to hide
mobile_icon_only 1 Show only search icon on mobile. Use 0 for full input

Examples

Example 1: Header Search Widget

When to use: Navigation bar search.

[anwpfl-search layout="dropdown" width="200" mobile_icon_only="1"]

Result: Compact search that expands on mobile tap.

Example 2: Teams Only Search

When to use: Team finder widget.

[anwpfl-search search="teams" width="300"]

Result: Search limited to team names.

Example 3: Player Search with Suggestions

When to use: Player finder with popular suggestions.

[anwpfl-search search="players" suggested="150,160,175" layout="inline"]

Result: Player search showing suggested players before typing.

Example 4: Full-Width Search Page

When to use: Dedicated search page.

[anwpfl-search layout="inline" width="400" mobile_icon_only="0"]

Result: Wide search with inline results display.

Tip

The suggested parameter lets you highlight featured teams or star players. These appear as quick-access links before the user starts typing.

Layout Comparison

Layout Best For
dropdown Headers, navigation bars, compact spaces
inline Search pages, sidebars, full-width sections

The same query in each layout – the difference is where the results go:

dropdown

Search shortcode, dropdown layout - results float over the page in a panel anchored under the search box

inline

Search shortcode, inline layout - results push the page down and render in the normal document flow under the search box

Troubleshooting

Search not showing results?

  • Verify teams/players exist in the database
  • Check that entities are published (not draft)
  • Ensure JavaScript is enabled in the browser

Related