DocsOAdsPlacement & Shortcodes
Features

Placement & Shortcodes

OAdsorravo.com/docs/oads/placement-shortcodes

Placement & Shortcodes

Shortcode

[oads]
[oads section="blog" count="2"]
[oads type="inline" section="shop"]
[oads zone="sidebar-top"]
AttributeDefaultOptions
sectionglobalAny section slug or zone slug
count1Integer
typecardcard, inline
zoneNamed 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> via wp_footer

Capped at 3 ads per page total. Ads inside <header> or <footer> elements are automatically hidden via a <style> injection.

Placement & Shortcodes — OAds Docs — Orravo