Responsive Ad Shortcodes 1.0

Responsive Ad Shortcodes is a WordPress plugin that was built to scratch an itch. For some time, we’ve been trying to get AdSense and DoubleClick to play nice with responsive websites. Not easy, as the responsive ad offerings from Google fall very short and offer little control. This plugin aims to address this, allowing users to control ad display on 3 types of screen (small, medium & large). And blend ads from AdSense and DoubleClick into single units.

Because of the focus on control and flexibility this plugin uses VERY verbose shortcodes. It is not designed for newbies. If you want a simple AdSdene short code manage, take a look at WP Simple AdSense Insertion.

Core Concept

This plugin assumes you are working with a responsive site model along the lines of Bootstrap, which is what most people seem to use these days. This means that the defining metric which decides which ad to use is width. This plugin calculates the width of the parent element and decides which of your ads (small, medium & large) to place. It’s important that you order the sizes appropriately starting with largest width.

Responsive Web Design by Ethan Marcotte

Example Shortcode

[ras aligns="center|center|center" slots="5940543366|5940543366|5940543366" formats="horizontal|horizontal|horizontal" sizes="970x90x1|728x90x1|320x50x1" adtext="1|1|1"]

Arguments

aligns
Values can be left, right or center. There should be 3 values seperated by |. The first value is the alignment for the large ad placement, the second for the medium and third for the small ad placement.
slots
Values should refer to an AdSense or DoubleClick ad slot IDs. There should be 3 values seperated by |. The first value is the slot ID for the large ad placement, the second for the medium and third for the small ad placement.
formats
Values can be horizontal, vertical or rectangle. There should be 3 values seperated a |. The first value is the ad format for the large ad placement, the second for the medium and third for the small ad placement.
sizes
Values need to be structured strings of 3 sets of numbers seperated by x. The first number is the width, the second the height and the third is a boolean to turn ad display on or off. There should be 3 values seperated by |. The first value is the ad format for the large ad placement, the second for the medium and third for the small ad placement.
adtext
Values can be 1 or 0. There should be 3 values seperated by |. The first value turns of the advertisment label for the large ad placement, the second for the medium and third for the small ad placement.

That’s it! If you need help, use the WordPress support forum for this plugin.