The country selector widget can be displayed by using a shortcode, or by dragging and dropping it to any widget area, like any standard WordPress widget. You can find more details about the two methods below
How to display the widget using a shortcode
You can call the shortcode as in the example below:
[aelia_pbc_country_selector_widget title="Widget title (optional)" widget_type="dropdown"]
The shortcode accepts the following parameters:
The widget title (optional)
The widget type. The Prices by Country plugin supports a dropdown. Further types can be added by implementing a filter in your theme for wc_aelia_pbc_customer_country_selector_widget_types hook. If this parameter is not specified, dropdown widget type will be rendered by default.
How to use the shortcode via PHP
If you would like to call the shortcode from your template code, you can use WordPress' do_shortcode() function, like in the following example:
// Display the widget with countries in a dropdown list echo do_shortcode('[aelia_pbc_country_selector_widget title="My widget title" widget_type="dropdown"]');
For more information about using shortcodes vua PHP, please refer to WordPress Codex. Function Reference/do shortcode/.
How to display the widget using sidebars/widget areas
The country selector widget can be dragged and dropped like any standard WordPress widget. To do so, you can proceed as follows.
Go to the Wordpress Admin Panel > Appearance > Widgets.
- Expand the sidebar/widget area where you would like to position the widget.
- Drag and drop the country selector in the new widget area,
Change the widget title as you wish.
Now the selector will be displayed in the frontend, in the area you selected.