🚧 This documentation is in beta. Please report any issues.
Documentation
Display Banners
Shortcode

Shortcode

Another way to display your banners is by using the shortcode [wp_bannerize_pro].

wp_bannerize_pro

The shortcode accepts the following parameters:

Params

NameDefaultDescription
idnullID or slug comma separate (default null)
numbers10Max numbers of banners (default 10)
categories[]Banner categories slug or id (default '')
order"DESC"Order ASC or DESC
rank_seedtrueSet to true to give some chances to the banners to be showed when use Impressions, Click or CTR
orderby"menu_order"Order by or menu_order, impressions, clicks, ctr or random. (default menu_order)
post_categories[]Any string, int or array of string, id. (default '')
layoutverticalBanners layout, "horizontal" or "vertical" (default 'vertical')
mobile0Display only on mobile devices (default 0)
desktop0Display only on desktop devices (default 0)
⚠️
Important

The attribute categories is deprecated. Use campaigns instead.

Display a single banners

[wp_bannerize_pro id="1678"/]
[wp_bannerize_pro id="my-banner-slug"/]
[wp_bannerize_pro id="1678,my-banner-slug"/]

Display random banners

[wp_bannerize_pro numbers="1" orderby="random"/]

Display banners in campaigns (ex categories)

[wp_bannerize_pro orderby="random" categories="56"]
[wp_bannerize_pro orderby="random" categories="sidebar-blog"]
[wp_bannerize_pro orderby="random" categories="56,sidebar-blog"]

Display bannners in Post Categories

[wp_bannerize_pro post_categories="news,events"/]
[wp_bannerize_pro post_categories="34,67"/]
[wp_bannerize_pro post_categories="news,events,34,67"/]

Devices Targeting

Bannerize provides the ability to target banners based on the device type and the user's location. You can use the following extra shortcode:

  • wp_bannerize_pro_mobile
  • wp_bannerize_pro_desktop

Devices Examples

You may use the wp_bannerize_pro_mobile and wp_bannerize_pro_desktop shortcodes to display anything only on mobile or desktop devices.

[wp_bannerize_pro_mobile]
  <h3>You're from mobile</h3>
  [wp_bannerize_pro id="1678"]
[/wp_bannerize_pro_mobile]

The short way to display a banner only on mobile devices is:

[wp_bannerize_pro mobile="1" id="1678" /]

Same for desktop devices:

[wp_bannerize_pro_desktop]
  <h3>You're from desktop</h3>
  [wp_bannerize_pro id="1678"]
[/wp_bannerize_pro_desktop]

The short way to display a banner only on desktop devices is:

[wp_bannerize_pro desktop="1" id="1678" /]

GEO Targeting

Bannerize provides the ability to target banners based on the user's location. We are using the WP Bones Geo Localizer package (opens in a new tab) to achieve this. Currently, this package supports the API service provides by IPStack (opens in a new tab)

Get your IPStack API key

To use the GEO targeting feature, you need to get your API key from IPStack (opens in a new tab) Once you have your API key, you can set it in the Bannerize settings page.

The IPStack API key is free for up to 100 requests per month.

wp_bannerize_pro_geo

The shortcode accepts the following parameters:

Params

NameDefaultDescription
city[]cities name (default '')
region_name[]region name (default '')
country_code[]country code (default '')
country_name[]country name (default '')
zip_code[]zip code (default '')
ip[]IP address (default '')
time_zone[]time zone (default '')

GEO Targeting Examples

You may use the wp_bannerize_pro_geo shortcode to display anything only on specific locations.

[wp_bannerize_pro_geo city="rome"]
  <h3>You're from Rome</h3>
  [wp_bannerize_pro id="1678"]
[/wp_bannerize_pro_geo]

Let's see more examples:

[wp_bannerize_pro_geo city="Rome"]
  Only for Rome
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo city="rome"]
  Only for Rome
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo city="rome,london"]
  Only for Rome and Landon
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo region_name="lazio"]
  Only for region (Italy) Lazio
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo country_code="IT"]
  Italian only
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo country_name="italy"]
  Italian only
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo zip_code="00137"]
  Wow
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo ip="80.182.82.82"]
  Only for me
[/wp_bannerize_pro_geo]
[wp_bannerize_pro_geo time_zone="europe/rome"]
  Rome/Berlin time zone
[/wp_bannerize_pro_geo]