Guide

WordPress

WordPress Integration

Add ads to your WordPress site

1 Gutenberg Block Editor (Recommended)

The easiest way to add ads to your posts and pages using the block editor.

1

Open your post or page in the Gutenberg editor

2

Click the + button to add a new block

3

Search for "Custom HTML" block

4

Paste this code:

<iframe src="https://example.com/ad-slot-id" style="width:100%;height:auto;min-height:90px;border:none;overflow:hidden;" frameborder="0" scrolling="no"></iframe>

2 Widget Area (Sidebar/Footer)

Perfect for displaying ads in your sidebar, footer, or other widget areas.

1

Go to Appearance → Widgets

2

Add a "Custom HTML" widget to your desired area

3

Paste the embed code and save

<iframe src="https://example.com/ad-slot-id" style="width:100%;height:auto;min-height:90px;border:none;overflow:hidden;" frameborder="0" scrolling="no"></iframe>

3 Theme Template (Advanced)

For developers who want to embed ads directly in theme files.

1

Open your theme's template file (e.g., single.php, header.php)

2

Add the embed code where you want the ad to appear

<iframe src="https://example.com/ad-slot-id" style="width:100%;height:auto;min-height:90px;border:none;overflow:hidden;" frameborder="0" scrolling="no"></iframe>

💡 Tip: Use a child theme to avoid losing changes when the parent theme updates.

4 Shortcode (Reusable)

Create a shortcode to easily insert this ad anywhere with [beaver_ad].

Add this to your theme's functions.php:

// Beaver.ad Embed
function beaver_ad_embed() {
    return '<iframe src="https://example.com/ad-slot-id" style="width:100%;height:auto;min-height:90px;border:none;overflow:hidden;" frameborder="0" scrolling="no"></iframe>';
}
add_shortcode('beaver_ad', 'beaver_ad_embed');

Then use this shortcode anywhere in your content:

[beaver_ad]