There are four methods of the outputting of ads.

  1. Automatic embedding into the site content
  2. Widgets
  3. WordPress Shortcodes
  4. Using functions

Automatic Embedding


This method is described in detail in the section “Settings”.



sam-pro-lite-place-widget sam-pro-lite-block-widget

To display ads in any sidebar you can use the widgets of the SAM Pro Free plugin. There are four widgets – Ad, Place, Zone and Block. Just drop any of these widgets to the sidebar you need and adjust it.

Title – title of widget if needed.

Ad, Place, Zone, Block – select the necessary ad object.

You can hide widget style (usually for the header widgets) and allow using predefined tags (Place, Zone).

WordPress Shortcodes



Click “Insert Advertisement” toolbar button, in opened dialog select necessary Ad Object and click “Insert” button. If necessary, check the box “Allow predefined tags”.

If you want insert shortcode manually use following code:

[sam_pro id='1_1' codes='true']

Where the first digit in the id is:

  • 0: Place
  • 1: Ad
  • 2: Zone
  • 3: Block

The second digit is id of the Ad Object.

Also you can use shortcodes in the WPtouch Pro Multi-Ads addon.

Using functions


In order that would insert an Ad Object in any place of theme template, use the samProDrawAd, samProDrawPlace, samProDrawZone or samProDrawBlock functions.

Output functions are defined as follows:

  • id – Ad Object id
  • args – array, which may include the wrapping tags (before and after parts of tags)
  • useTags – allow wrapping tags

Using Functions:


From version you can use more flexible alternative of outputting ads. Using this method you can obtain an Ad Object and use its data as you need. For example for defining objects of Google Analitics.

For that you should use public methods getAd , getPlace , getZone  and getBlock  of $samProObject , it is the global instance of the main plugin’s object.

Returned object contains next public data:

  • ad – HTML tags of current ad
  • width – the width of ad
  • height – the height of ad
  • aid – ID of current ad
  • pid – ID of Place (this data is not available for object returned by getAd  method)
  • adName – the name of ad
  • eid – ID of the HTML element of ad

Using Methods:

Disabling Ad Serving

You can disable ad serving on any post or page of your blog.


Just turn on “disable ad serving” checkbox. Ads will not be shown in this article or on this page.

© 2015 – 2017, minimus. All rights reserved.