Placement & Shortcodes
Shortcode
[oads]
[oads section="blog" count="2"]
[oads type="inline" section="shop"]
[oads zone="sidebar-top"]
| Attribute | Default | Options |
|---|---|---|
section | global | Any section slug or zone slug |
count | 1 | Integer |
type | card | card, inline |
zone | — | Named zone slug |
PHP template functions
php// Show 1 card ad in blog section
oads_show( 'blog', 1 );
// Show 2 inline ads
oads_show_inline( 'global', 2 );
// Get raw HTML string
$html = oads_get( 'homepage', 1 );
// Inject ad every 6 items in a WP_Query loop
foreach ( $items as $i => $item ) {
// … render item …
oads_inject_in_loop( 'blog', 6, $i );
}
// Render a named zone
oads_zone( 'sidebar-top', 'card' );
WP action hook
phpdo_action( 'oads_zone', 'blog', 'inline' );
Automatic injection
OAds auto-injects into:
- In-content posts: after paragraph 3 and paragraph 7
- Archive/listing pages: into the largest CSS Grid, every N items
- Sticky bar ads: into
<body>viawp_footer
Capped at 3 ads per page total. Ads inside <header> or <footer> elements are automatically hidden via a <style> injection.
