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.
Open your post or page in the Gutenberg editor
Click the + button to add a new block
Search for "Custom HTML" block
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.
Go to Appearance â Widgets
Add a "Custom HTML" widget to your desired area
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.
Open your theme's template file (e.g., single.php, header.php)
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]