Version Description
- Bug fix: Block code textarea was not escaped
- Added checks for page types for shortcodes
- Added support for Before/After Post position call counter/filter
- Few minor cosmetic changes
Download this release
Release Info
Developer | spacetime |
Plugin | Ad Inserter – WordPress Ads Management with AdSense Header Integration |
Version | 1.6.7 |
Comparing to | |
See all releases |
Code changes from version 1.6.6 to 1.6.7
- ad-inserter.php +60 -7
- constants.php +1 -1
- js/ad-inserter.js +4 -1
- readme.txt +176 -92
- screenshot-1.jpg +0 -0
- screenshot-10.jpg +0 -0
- screenshot-2.jpg +0 -0
- settings.php +9 -7
ad-inserter.php
CHANGED
@@ -1,15 +1,22 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Ad Inserter
|
4 |
-
Version: 1.6.
|
5 |
Description: Insert any ad code into Wordpress. Perfect for AdSense or Amazon ads. Simply enter any HTML, Javascript or PHP code and select where and how you want to display it.
|
6 |
-
Author:
|
7 |
-
Author URI: http://
|
|
|
8 |
*/
|
9 |
|
10 |
/*
|
11 |
Change Log
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
Ad Inserter 1.6.6 - 5 August 2016
|
14 |
- Bug fix: Display on Homepage and other blog pages might get disabled - important if you were using PHP function call or shortcode (import of settings from 1.6.4)
|
15 |
- Few minor cosmetic changes
|
@@ -1378,13 +1385,19 @@ function ai_excerpt_hook ($content = ''){
|
|
1378 |
// Process Before / After Post postion
|
1379 |
|
1380 |
function ai_before_after_post ($query, $display_type){
|
1381 |
-
global $block_object;
|
1382 |
|
1383 |
if (!method_exists ($query, 'is_main_query')) return;
|
1384 |
if (!$query->is_main_query()) return;
|
1385 |
if (is_feed()) return;
|
1386 |
if (strpos ($_SERVER ['REQUEST_URI'], '/wp-admin/') === 0) return;
|
1387 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1388 |
$meta_value = get_post_meta (get_the_ID (), '_adinserter_block_exceptions', true);
|
1389 |
$selected_blocks = explode (",", $meta_value);
|
1390 |
|
@@ -1464,6 +1477,13 @@ function ai_before_after_post ($query, $display_type){
|
|
1464 |
|
1465 |
if (!$obj->check_and_increment_block_counter ()) continue;
|
1466 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1467 |
$block_class_name = get_block_class_name ();
|
1468 |
|
1469 |
if ($obj->get_alignment_type() == AD_ALIGNMENT_NO_WRAPPING) $ad_code .= ai_getAdCode ($obj); else
|
@@ -1559,10 +1579,43 @@ function process_shortcodes ($atts) {
|
|
1559 |
if ($display_for_devices == AD_DISPLAY_DESKTOP_PHONE_DEVICES && !(AI_DESKTOP || AI_PHONE)) return "";
|
1560 |
}
|
1561 |
|
1562 |
-
if (
|
|
|
1563 |
if (!$obj->check_date ()) return "";
|
1564 |
-
}
|
1565 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1566 |
if (!$obj->get_enable_404()) return "";
|
1567 |
}
|
1568 |
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Ad Inserter
|
4 |
+
Version: 1.6.7
|
5 |
Description: Insert any ad code into Wordpress. Perfect for AdSense or Amazon ads. Simply enter any HTML, Javascript or PHP code and select where and how you want to display it.
|
6 |
+
Author: Igor Funa
|
7 |
+
Author URI: http://igorfuna.com/
|
8 |
+
Plugin URI: http://tinymonitor.com/ad-inserter
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
Change Log
|
13 |
|
14 |
+
Ad Inserter 1.6.7 - 9 August 2016
|
15 |
+
- Bug fix: Block code textarea was not escaped
|
16 |
+
- Added checks for page types for shortcodes
|
17 |
+
- Added support for Before/After Post position call counter/filter
|
18 |
+
- Few minor cosmetic changes
|
19 |
+
|
20 |
Ad Inserter 1.6.6 - 5 August 2016
|
21 |
- Bug fix: Display on Homepage and other blog pages might get disabled - important if you were using PHP function call or shortcode (import of settings from 1.6.4)
|
22 |
- Few minor cosmetic changes
|
1385 |
// Process Before / After Post postion
|
1386 |
|
1387 |
function ai_before_after_post ($query, $display_type){
|
1388 |
+
global $block_object, $ad_interter_globals;
|
1389 |
|
1390 |
if (!method_exists ($query, 'is_main_query')) return;
|
1391 |
if (!$query->is_main_query()) return;
|
1392 |
if (is_feed()) return;
|
1393 |
if (strpos ($_SERVER ['REQUEST_URI'], '/wp-admin/') === 0) return;
|
1394 |
|
1395 |
+
$globals_name = 'LOOP_COUNTER_'.str_replace (" ", "", $display_type);
|
1396 |
+
|
1397 |
+
if (!isset ($ad_interter_globals [$globals_name])) {
|
1398 |
+
$ad_interter_globals [$globals_name] = 1;
|
1399 |
+
} else $ad_interter_globals [$globals_name] ++;
|
1400 |
+
|
1401 |
$meta_value = get_post_meta (get_the_ID (), '_adinserter_block_exceptions', true);
|
1402 |
$selected_blocks = explode (",", $meta_value);
|
1403 |
|
1477 |
|
1478 |
if (!$obj->check_and_increment_block_counter ()) continue;
|
1479 |
|
1480 |
+
$counter_settings = $obj->get_excerpt_number();
|
1481 |
+
$numbers = array ();
|
1482 |
+
if (strpos ($counter_settings, ",") !== false) {
|
1483 |
+
$numbers = explode (",", $counter_settings);
|
1484 |
+
} else $numbers []= $counter_settings;
|
1485 |
+
if ($counter_settings != 0 && !in_array ($ad_interter_globals [$globals_name], $numbers)) continue;
|
1486 |
+
|
1487 |
$block_class_name = get_block_class_name ();
|
1488 |
|
1489 |
if ($obj->get_alignment_type() == AD_ALIGNMENT_NO_WRAPPING) $ad_code .= ai_getAdCode ($obj); else
|
1579 |
if ($display_for_devices == AD_DISPLAY_DESKTOP_PHONE_DEVICES && !(AI_DESKTOP || AI_PHONE)) return "";
|
1580 |
}
|
1581 |
|
1582 |
+
if (is_front_page ()){
|
1583 |
+
if (!$obj->get_display_settings_home()) return "";
|
1584 |
if (!$obj->check_date ()) return "";
|
1585 |
+
} else if (is_single ()) {
|
1586 |
+
if (!$obj->get_display_settings_post ()) return "";
|
1587 |
+
if (!$obj->check_date ()) return "";
|
1588 |
+
|
1589 |
+
$meta_value = get_post_meta (get_the_ID (), '_adinserter_block_exceptions', true);
|
1590 |
+
$selected_blocks = explode (",", $meta_value);
|
1591 |
+
|
1592 |
+
$enabled_on_text = $obj->get_ad_enabled_on_which_posts ();
|
1593 |
+
if ($enabled_on_text == AD_ENABLED_ON_ALL_EXCEPT_ON_SELECTED) {
|
1594 |
+
if (in_array ($obj->number, $selected_blocks)) return "";
|
1595 |
+
}
|
1596 |
+
elseif ($enabled_on_text == AD_ENABLED_ONLY_ON_SELECTED) {
|
1597 |
+
if (!in_array ($obj->number, $selected_blocks)) return "";
|
1598 |
+
}
|
1599 |
+
} elseif (is_page ()) {
|
1600 |
+
if (!$obj->get_display_settings_page ()) return "";
|
1601 |
+
|
1602 |
+
$meta_value = get_post_meta (get_the_ID (), '_adinserter_block_exceptions', true);
|
1603 |
+
$selected_blocks = explode (",", $meta_value);
|
1604 |
+
|
1605 |
+
$enabled_on_text = $obj->get_ad_enabled_on_which_pages ();
|
1606 |
+
if ($enabled_on_text == AD_ENABLED_ON_ALL_EXCEPT_ON_SELECTED) {
|
1607 |
+
if (in_array ($obj->number, $selected_blocks)) return "";
|
1608 |
+
}
|
1609 |
+
elseif ($enabled_on_text == AD_ENABLED_ONLY_ON_SELECTED) {
|
1610 |
+
if (!in_array ($obj->number, $selected_blocks)) return "";
|
1611 |
+
}
|
1612 |
+
} elseif (is_category()){
|
1613 |
+
if (!$obj->get_display_settings_category()) return "";
|
1614 |
+
} elseif (is_search()){
|
1615 |
+
if (!$obj->get_display_settings_search()) return "";
|
1616 |
+
} elseif (is_archive()){
|
1617 |
+
if (!$obj->get_display_settings_archive()) return "";
|
1618 |
+
} elseif (is_404()){
|
1619 |
if (!$obj->get_enable_404()) return "";
|
1620 |
}
|
1621 |
|
constants.php
CHANGED
@@ -11,7 +11,7 @@ if (!defined( 'AD_INSERTER_TITLE'))
|
|
11 |
define ('AD_INSERTER_TITLE', 'Ad Inserter');
|
12 |
|
13 |
if (!defined( 'AD_INSERTER_VERSION'))
|
14 |
-
define ('AD_INSERTER_VERSION', '1.6.
|
15 |
|
16 |
if (!defined ('AD_INSERTER_BLOCKS'))
|
17 |
define ('AD_INSERTER_BLOCKS', 16);
|
11 |
define ('AD_INSERTER_TITLE', 'Ad Inserter');
|
12 |
|
13 |
if (!defined( 'AD_INSERTER_VERSION'))
|
14 |
+
define ('AD_INSERTER_VERSION', '1.6.7');
|
15 |
|
16 |
if (!defined ('AD_INSERTER_BLOCKS'))
|
17 |
define ('AD_INSERTER_BLOCKS', 16);
|
js/ad-inserter.js
CHANGED
@@ -94,10 +94,13 @@ jQuery(document).ready(function($) {
|
|
94 |
$("#display-search-"+block).is(":checked") ||
|
95 |
$("#display-archive-"+block).is(":checked"))
|
96 |
$("#blog-page-settings-"+block).show();
|
97 |
-
}
|
98 |
if (display_type == "Before Excerpt" || display_type == "After Excerpt") {
|
99 |
$("#paragraph-settings-"+block).hide();
|
100 |
$("#blog-page-settings-"+block).show();
|
|
|
|
|
|
|
101 |
}
|
102 |
|
103 |
if ($("#enable-php-call-"+block).is(":checked")) {
|
94 |
$("#display-search-"+block).is(":checked") ||
|
95 |
$("#display-archive-"+block).is(":checked"))
|
96 |
$("#blog-page-settings-"+block).show();
|
97 |
+
} else
|
98 |
if (display_type == "Before Excerpt" || display_type == "After Excerpt") {
|
99 |
$("#paragraph-settings-"+block).hide();
|
100 |
$("#blog-page-settings-"+block).show();
|
101 |
+
} else
|
102 |
+
if (display_type == "Before Post" || display_type == "After Post") {
|
103 |
+
$("#blog-page-settings-"+block).show();
|
104 |
}
|
105 |
|
106 |
if ($("#enable-php-call-"+block).is(":checked")) {
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: adsense, amazon, clickbank, cj, ad, ads, html, javascript, php, code, widget, sidebar, responsive, viewport, rotating, banner, banner rotation, contextual, shortcodes, widgets, header, footer, users, logged in, not logged in, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, skip
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.5.3
|
7 |
-
Stable tag: 1.6.
|
8 |
License: GPLv3
|
9 |
|
10 |
Insert any HTML/Javascript/PHP code into Wordpress. Perfect for AdSense or contextual Amazon ads. 16 code blocks, many display options.
|
@@ -15,7 +15,41 @@ Need to install ads or widgets on Wordpress website?
|
|
15 |
|
16 |
Ad Inserter is a simple yet powerful solution to insert any code into Wordpress. **Perfect for AdSense or contextual Amazon ads.** Simply enter any HTML/Javascript/PHP code and select where and how you want to display it.
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
Automatic Display Options:
|
21 |
|
@@ -27,11 +61,20 @@ Automatic Display Options:
|
|
27 |
* Display After Post (after post or posts on blog pages)
|
28 |
* Display Before Excerpt (on blog pages)
|
29 |
* Display After Excerpt (on blog pages)
|
|
|
30 |
|
31 |
For single posts or pages display position Before Post usually means position above the post/page title, for blog pages Before Post position means position above all the posts on the blog page.
|
32 |
|
33 |
For single posts or pages display position After Post means position below the post/page after all the content, for blog pages After Post position means position below all the posts on the blog page.
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
Order of display positions in a typical post is the following:
|
36 |
|
37 |
* [Before Post]
|
@@ -49,9 +92,23 @@ Order of display positions in a typical post is the following:
|
|
49 |
|
50 |
Of course, the final order of items depends also on other plugins. Ad Inserter is by default called as one of the last plugins. You can change Plugin priority on the settings page (tab #).
|
51 |
|
52 |
-
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
Single pages:
|
57 |
|
@@ -65,6 +122,10 @@ Blog pages:
|
|
65 |
* Search Pages
|
66 |
* Archive pages
|
67 |
|
|
|
|
|
|
|
|
|
68 |
**Please Note** Paragraph processing works on **every** post or page according to settings. Therefore, if you enable display also on blog pages (home, category, archive, search pages) and your theme does not display post excerpts but complete posts,
|
69 |
Ad Inserter will by default insert code blocks into ALL posts on the blog page (according to settings). To enable insertion only into specific post(s) on blog pages define Excerpt/Post number(s). You can also leave Excerpt/Post number to 0 (means all posts on the blog page) and define maximum number of insertions.
|
70 |
|
@@ -78,32 +139,51 @@ Paragraphs can be counted from top or from bottom. It is also possible to count
|
|
78 |
|
79 |
You can also define paragraph HTML tags. Normally only `<p>` tags are used. If your post contains also `<div>` or header tags, you can define comma separated list of tags used to count paragraphs (e.g. **p, div, h2, h3**).
|
80 |
**WARNING:** Each code block you insert in post adds one `<div>` block unelss you use **No wrapping** style. **Before Paragraph** will insert code before `<tag>`, **After Paragraph** will insert code after closing `</tag>`.
|
81 |
-
**After Paragraph** will not work if you specify tag names that have no closing tags! Use # as tag
|
|
|
|
|
|
|
|
|
82 |
|
83 |
On the Ad Inserter settings page (tab #) you also have option Tag Debugging. If enabled, it displays paragraph tags surrounded with a border. This way you can check where your code will be inserted. You can select to show paragraph tags before or after plugin processing. If Before Processing is selected Ad Inserter WILL NOT insert any code!
|
84 |
|
85 |
Additional Display Options:
|
86 |
|
87 |
-
*
|
88 |
-
* Manual - Insert shortcode [adinserter block="BLOCK_NUMBER"] or [adinserter name="BLOCK_NAME"] into post or page HTML code to display block with BLOCK_NAME name or BLOCK_NUMBER number at this position.
|
89 |
* PHP function call `<?php if (function_exists ('adinserter')) echo adinserter (BLOCK_NUMBER); ?>` - Insert code block BLOCK_NUMBER at any position in template file. With PHP function call counter (Excerpt/Post number) you can also define which call(s) to the function will actually insert code.
|
90 |
This is useful if you put a call to the `adinserter` function inside a loop in a template file (e.g. for homepage) and you need to insert ads only few times between posts.
|
91 |
|
92 |
-
Additional Options:
|
|
|
|
|
93 |
|
94 |
* Use {category}, {short_category}, {title}, {short_title}, {tag}, {smart_tag} or {search_query} tags to insert actual post data into code blocks
|
95 |
* Use {author} for post author username or {author_name} for post author name to insert post author data into code blocks (**works only inside posts**)
|
96 |
-
* To rotate different ad versions separate them with
|
97 |
|
98 |
-
|
99 |
|
100 |
-
|
101 |
-
* Logged in users
|
102 |
-
* Not logged in users
|
103 |
|
104 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
-
Devices
|
107 |
|
108 |
**IMPORTANT:** There are two types of device detection: **server side** and **client-side**.
|
109 |
|
@@ -117,7 +197,9 @@ Devices:
|
|
117 |
|
118 |
**PLEASE NOTE:** In most cases you should use **ONLY client-side** detection type. Works perfectly with responsive designs as they use CSS media queries.
|
119 |
|
120 |
-
|
|
|
|
|
121 |
|
122 |
* Desktop: 980 pixels or more
|
123 |
* Tablet: from 768 pixels to 979 pixels
|
@@ -134,85 +216,30 @@ Up to 3 viewport names and widths can be defined on the Ad Inserter Settings tab
|
|
134 |
* Desktop and phone devices
|
135 |
|
136 |
**Server-side** detection of mobile/desktop devices works only when Ad Inserter plugin is called. It is called by Wordpress when it needs to generate a page. However, when you are using caching, it saves created page for quicker serving.
|
137 |
-
In such cases **the user might get (saved) page for wrong device
|
138 |
Server-side detection uses User-Agent string combined with specific HTTP headers to detect the environment.
|
139 |
|
140 |
-
**PLEASE NOTE:** Use server-side device type detection only when you need to generate ONLY code blocks for specific device type. In all other cases switch it off.
|
141 |
-
|
142 |
-
|
143 |
-
Block Alignment and Style:
|
144 |
-
|
145 |
-
* No Wrapping (leaves ad code as it is, otherwise it is wrapped by a div)
|
146 |
-
* Custom CSS (You can define custom CSS code for wrapping div)
|
147 |
-
* None (simple div with thin margin)
|
148 |
-
* Align Left
|
149 |
-
* Align Right
|
150 |
-
* Center
|
151 |
-
* Float Left (ad on left with wrapped text on right)
|
152 |
-
* Float Right (ad on right with wrapped text on left)
|
153 |
-
|
154 |
-
Check <a href="https://wordpress.org/plugins/ad-inserter/screenshots/">screenshots</a> for explanation on alignment.
|
155 |
-
|
156 |
-
**PLEASE NOTE:** If you are using **No Wrapping** style and need to hide code on some devices using client-side detection (CSS Media Queries) then you need to add appropriate class to your CSS code (ai-viewport-1, ai-viewport-2, ai-viewport-3).
|
157 |
-
This doesn't apply to widgets as they always contain a wrapping div.
|
158 |
|
159 |
-
|
160 |
-
Enable processing of PHP code. If there is an error in the PHP code, it will not break the website.
|
161 |
-
|
162 |
-
Do not display ad if the number of paragraphs or the number of words is below limit (used only for position Before or After selected paragraph).
|
163 |
-
|
164 |
-
Display only for posts published after N days checks the date when the post was published.
|
165 |
-
|
166 |
-
Do not display ads in certain caregories e.g sport, news, science,... (black list) or display ads only in certain categories (white list).
|
167 |
-
Leave category list empty and set it to Black list to show ads in all categories.
|
168 |
-
**WARNING:** If category name contains commas use category slug instead. Also make sure you have enabled display on **Category pages**.
|
169 |
-
|
170 |
-
Do not display ads in posts with certain tags (black list) or display ads only in posts with certain tags (white list). Leave tag list empty and set it to Black list to show ads for all tags. Also make sure you have enabled display on **Archive pages**.
|
171 |
-
|
172 |
-
Do not display ads on pages with certain urls (black list) or display ads only pages with certain urls (white list). Leave url list empty and set it to Black list to show ads on all urls.
|
173 |
-
Url used here is everything starting form the `/` after the domain name. For example: if web address is `http://domain.com/lorem-ipsum`, url to white/black-list is `/lorem-ipsum`
|
174 |
-
You can also use partial urls with *. To filter all urls starting with /url-start use `/url-start*`, to filter all urls that contain url-pattern use `*url-pattern*`, to filter all urls ending with url-end use `*url-end`.
|
175 |
-
**WARNING:** Separate urls with SPACES.
|
176 |
-
|
177 |
-
Do not display ads to users from certain referers (domains) e.g technorati.com, facebook.com,... (black list) or display ads only for certain referrers (white list). Use # for no referer (direct visit).
|
178 |
-
Leave referrers list empty and set it to Black list to show ads for all referrers.
|
179 |
-
|
180 |
-
**WARNING:** If you are using caching, referer check may not work as expected. It works only when the page is generated and Ad Inserter is called. Make sure you have disabled caching when you are using such settings.
|
181 |
-
|
182 |
-
**IMPORTANT:** For any display position you should also ENABLE AT LEAST ONE WORDPRESS PAGE TYPE where the ads can be displayed:
|
183 |
-
|
184 |
-
Single pages:
|
185 |
-
|
186 |
-
* Posts
|
187 |
-
* Pages
|
188 |
|
189 |
-
|
190 |
|
191 |
-
|
192 |
|
193 |
-
|
194 |
-
* Category pages
|
195 |
-
* Search Pages
|
196 |
-
* Archive pages
|
197 |
|
198 |
-
|
199 |
|
200 |
-
|
201 |
|
202 |
-
|
203 |
|
204 |
Support for Special Code Blocks:
|
205 |
|
206 |
-
* Header scripts (
|
207 |
-
* Footer scripts (
|
208 |
-
|
209 |
-
Wrapping divs for code blocks have 'code-block' and 'code-block-N' classes which can be used for custom styles. Class name 'code-block' can be changed in Ad Inserter settings. If you are using client-side device detection (CSS media queries) then the wrapping div for the code block will have also some of the following classes: ai-viewport-1, ai-viewport-2, ai-viewport-3.
|
210 |
|
211 |
-
To configure syntax highlighting go to Ad Inserter Settings (tab #) and choose theme.
|
212 |
-
|
213 |
-
By default Ad Inserter exceptions on posts/pages are enabled only for administrators. You can define minimum user role for page/post Ad Inserter exceptions editing in Ad Inserter Settings (tab #).
|
214 |
-
|
215 |
-
Default Ad Inserter plugin processing order is 99999. It is used to specify the order in which the plugin functions are executed. Lower numbers correspond with earlier execution. You can change this value if you have problems with the processing order of other plugins.
|
216 |
|
217 |
**WARNING:** Text selection, Copy and Paste functions with the syntax highlighting editor do not work on mobile devices. If you need these functions you can temporarily swich to **Simple editor** using the checkbox above the code box.
|
218 |
|
@@ -229,7 +256,9 @@ In such cases please make sure you have disabled caching when you are using such
|
|
229 |
If you experience problems with the Ad Inserter plugin you can ask for help on the <a href ="https://wordpress.org/support/plugin/ad-inserter">support forum</a>.
|
230 |
However, in order to be able to diagnose the problem and suggest actions or fix a bug, please do the following:
|
231 |
|
232 |
-
|
|
|
|
|
233 |
|
234 |
1. Clear description of the problem. Describe what does not work as expected.
|
235 |
|
@@ -249,13 +278,7 @@ Thank you very much for understanding.
|
|
249 |
1. Download the plugin,
|
250 |
2. Go to Wordpress Plugins, Add New, Upload Plugin
|
251 |
3. Choose file, click on Install Now, activate it
|
252 |
-
3. Go to
|
253 |
-
|
254 |
-
**Ad Inserter Pro Installation**
|
255 |
-
|
256 |
-
If you are using free Ad Inserter simply uninstall it. The Pro version will automatically import existing settings from the free version.
|
257 |
-
After you receive the email with download link for the Ad Inserter Pro plugin, download it, go to Wordpress Plugins, Add New, Upload Plugin, Choose file, click on Install Now,
|
258 |
-
activate it and then click "Enter License Key" and enter license key you got in the email. If you need to edit license key go to Ad Inserter settings (tab #).
|
259 |
|
260 |
**WARNING:** Some adblockers may block Ad Inserter settings page. If you don't see normal tabs for code blocks or there is no save button, make sure you have whitelisted Ad Inserter settings page.
|
261 |
|
@@ -269,6 +292,15 @@ In such cases please make sure you have disabled caching when you are using such
|
|
269 |
Before you report problem please check source code of the page and make sure the code is not inserted where it should be.
|
270 |
The code may be inserted properly but you won't see anything. Try to add some text after the ad code to check if it appears at the expected ad position.
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
== Frequently Asked Questions ==
|
273 |
|
274 |
= I have activated Ad Inserter. How can I use it? =
|
@@ -333,12 +365,45 @@ The code may be inserted properly but you won't see anything. Try to add some te
|
|
333 |
* Tags: Cars, White List checked
|
334 |
|
335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
= How can I replace deprecated tags {adinserter n} for manual insertion with new ones [adinserter block="n"] in all posts? =
|
337 |
|
338 |
Use <a href="https://wordpress.org/plugins/search-regex/" target="_blank">Search Regex</a> plugin to replace tags in all posts with few clicks. If you are not familiar with regular expressions simply use search and replace text for each code block. Use **Replace** to test replacements and when it works as expected use **Replace & Save**.
|
339 |
|
340 |
|
341 |
-
= How can I
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
|
343 |
1. Go to Ad Inserter settings page and define default display options for post/page.
|
344 |
2. Enable automatic display on posts/pages and choose default display: **On all**, **On all except selected** or **Only on selected**.
|
@@ -346,6 +411,12 @@ Use <a href="https://wordpress.org/plugins/search-regex/" target="_blank">Search
|
|
346 |
4. Check default display options for wanted code blocks.
|
347 |
5. Set exceptions for this post or page.
|
348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
|
350 |
= I'm using responsive theme. How can I show or hide some ads on mobile devices? =
|
351 |
|
@@ -534,7 +605,7 @@ AD CODE RIGHT
|
|
534 |
|
535 |
== Screenshots ==
|
536 |
|
537 |
-
1. Settings for one code block (Widget). Up to 16 blocks can be configured.
|
538 |
2. Settings for one code block (Before Paragraph)
|
539 |
3. Alignment **Left**, **None** - None means default (usually left) aligned ad block with thin margin around
|
540 |
4. Alignment **Right** - Right aligned ad block with thin margin around
|
@@ -549,6 +620,12 @@ AD CODE RIGHT
|
|
549 |
|
550 |
== Changelog ==
|
551 |
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
= 1.6.6 =
|
553 |
- Bug fix: Display on Homepage and other blog pages might get disabled - important if you were using PHP function call or shortcode (import of settings from 1.6.4)
|
554 |
- Few minor cosmetic changes
|
@@ -739,6 +816,12 @@ AD CODE RIGHT
|
|
739 |
|
740 |
== Upgrade Notice ==
|
741 |
|
|
|
|
|
|
|
|
|
|
|
|
|
742 |
= 1.6.6 =
|
743 |
Bug fix: Display on Homepage and other blog pages might get disabled - important if you were using PHP function call or shortcode (import of settings from 1.6.4)
|
744 |
Few minor cosmetic changes;
|
@@ -921,3 +1004,4 @@ Support for different sidebar implementations in various themes
|
|
921 |
= 1.0.0 =
|
922 |
Initial release
|
923 |
|
|
4 |
Tags: adsense, amazon, clickbank, cj, ad, ads, html, javascript, php, code, widget, sidebar, responsive, viewport, rotating, banner, banner rotation, contextual, shortcodes, widgets, header, footer, users, logged in, not logged in, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, skip
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.5.3
|
7 |
+
Stable tag: 1.6.6
|
8 |
License: GPLv3
|
9 |
|
10 |
Insert any HTML/Javascript/PHP code into Wordpress. Perfect for AdSense or contextual Amazon ads. 16 code blocks, many display options.
|
15 |
|
16 |
Ad Inserter is a simple yet powerful solution to insert any code into Wordpress. **Perfect for AdSense or contextual Amazon ads.** Simply enter any HTML/Javascript/PHP code and select where and how you want to display it.
|
17 |
|
18 |
+
Ad Inserter supports up to 16 code blocks. Code block is any code (for example AdSense ad) that has to be inserted (displayed) at some position.
|
19 |
+
Each code block can be configured to insert code at almost any position supported by Wordpress.
|
20 |
+
|
21 |
+
**Features**
|
22 |
+
|
23 |
+
* 16 code blocks
|
24 |
+
* Syntax highlighting editor
|
25 |
+
* Automatic positions: before/after post, content, paragraph or excerpt
|
26 |
+
* Manual positions: shortcodes, PHP function call
|
27 |
+
* Block alignment and style: left, center, right, float left, float right, custom CSS, no wrapping
|
28 |
+
* PHP code processing
|
29 |
+
* Server-side and client-side device detection (3 custom viewports)
|
30 |
+
* Black/White-list categories, tags, urls, referers
|
31 |
+
|
32 |
+
And there is also <a href="http://tinymonitor.com/ad-inserter-pro" target="_blank">Ad Inserter Pro</a> if you need more than 16 code blocks or more than 3 viewports.
|
33 |
+
|
34 |
+
**Quick Start**
|
35 |
+
|
36 |
+
You need to know two very important things in order to insert code and display some ad:
|
37 |
+
|
38 |
+
* You need to **enable and use at least one display option** (Automatic Display, Widget, Shortcode, PHP function call)
|
39 |
+
* You need to **enable display on at least one Wordpress page type** (Posts, Pages, Blog pages, Homepage, Category pages, Search Pages, Archive pages)
|
40 |
+
|
41 |
+
Few typical settings are described on the <a href="https://wordpress.org/plugins/ad-inserter/faq/">FAQ</a> page. Please make sure you have also read **WARNINGS** on the bottom of this page!
|
42 |
+
|
43 |
+
**Settings**
|
44 |
+
|
45 |
+
Each code block has 4 independent display options:
|
46 |
+
|
47 |
+
* Automatic Display
|
48 |
+
* Widget
|
49 |
+
* Shortcode
|
50 |
+
* PHP function call
|
51 |
+
|
52 |
+
To display code block (ad) at some position **you need to enable and use at least one display option**.
|
53 |
|
54 |
Automatic Display Options:
|
55 |
|
61 |
* Display After Post (after post or posts on blog pages)
|
62 |
* Display Before Excerpt (on blog pages)
|
63 |
* Display After Excerpt (on blog pages)
|
64 |
+
* As a Widget - Simply drag **Ad Inserter** widget to any widget postition (e.g. Sidebar), select code block, save and you're done.
|
65 |
|
66 |
For single posts or pages display position Before Post usually means position above the post/page title, for blog pages Before Post position means position above all the posts on the blog page.
|
67 |
|
68 |
For single posts or pages display position After Post means position below the post/page after all the content, for blog pages After Post position means position below all the posts on the blog page.
|
69 |
|
70 |
+
Display Block to:
|
71 |
+
|
72 |
+
* All users (default)
|
73 |
+
* Logged in users
|
74 |
+
* Not logged in users
|
75 |
+
|
76 |
+
**WARNING:** If you are using caching this may not work as expected. The check works only when the page is generated and Ad Inserter is called. Make sure you have disabled caching when you are using such settings.
|
77 |
+
|
78 |
Order of display positions in a typical post is the following:
|
79 |
|
80 |
* [Before Post]
|
92 |
|
93 |
Of course, the final order of items depends also on other plugins. Ad Inserter is by default called as one of the last plugins. You can change Plugin priority on the settings page (tab #).
|
94 |
|
95 |
+
Block Alignment and Style:
|
96 |
|
97 |
+
* No Wrapping (leaves ad code as it is, otherwise it is wrapped by a div)
|
98 |
+
* Custom CSS (You can define custom CSS code for wrapping div)
|
99 |
+
* None (simple div with thin margin)
|
100 |
+
* Align Left
|
101 |
+
* Align Right
|
102 |
+
* Center
|
103 |
+
* Float Left (ad on left with wrapped text on right)
|
104 |
+
* Float Right (ad on right with wrapped text on left)
|
105 |
+
|
106 |
+
Check <a href="https://wordpress.org/plugins/ad-inserter/screenshots/">screenshots</a> for explanation on alignment.
|
107 |
+
|
108 |
+
**PLEASE NOTE:** If you are using **No Wrapping** style and need to hide code on some devices using client-side detection (CSS Media Queries) then you need to add appropriate class to your CSS code (ai-viewport-1, ai-viewport-2, ai-viewport-3).
|
109 |
+
This doesn't apply to widgets as they always contain a wrapping div.
|
110 |
+
|
111 |
+
For all display positions you can also define Wordpress page types where the ads can be displayed. **PLEASE NOTE:** Regardles of other settings you need to enable display on AT LEAST ONE PAGE TYPE:
|
112 |
|
113 |
Single pages:
|
114 |
|
122 |
* Search Pages
|
123 |
* Archive pages
|
124 |
|
125 |
+
You can also disable ads on certain posts or pages. For each code block on posts or pages you first define default display settings for posts/pages page type. Then you can define post/page exceptions on the post/page editor page (check Ad Inserter Exceptions meta box below). Exceptions work only on page/post content (positions Before Content, Before Paragraph, After Paragraph, After Content). For one or few exceptions it is easier to first enable ads on All Posts/Pages page types and then either white or black-list single url or few space-separated urls (click on the Lists button).
|
126 |
+
|
127 |
+
For blog pages and display positions Before Excerpt / After Excerpt and Before Content / After Content you can also specify excerpt/post number or comma separated list of excerpt/post numbers (1 - 9). For Before Post / After Post positions this setting is a filter to limit/filter insertions before or after post if the theme inserts code block more than once. You can also leave Excerpt/Post number to 0 (means all posts on the blog page) and define maximum number of insertions.
|
128 |
+
|
129 |
**Please Note** Paragraph processing works on **every** post or page according to settings. Therefore, if you enable display also on blog pages (home, category, archive, search pages) and your theme does not display post excerpts but complete posts,
|
130 |
Ad Inserter will by default insert code blocks into ALL posts on the blog page (according to settings). To enable insertion only into specific post(s) on blog pages define Excerpt/Post number(s). You can also leave Excerpt/Post number to 0 (means all posts on the blog page) and define maximum number of insertions.
|
131 |
|
139 |
|
140 |
You can also define paragraph HTML tags. Normally only `<p>` tags are used. If your post contains also `<div>` or header tags, you can define comma separated list of tags used to count paragraphs (e.g. **p, div, h2, h3**).
|
141 |
**WARNING:** Each code block you insert in post adds one `<div>` block unelss you use **No wrapping** style. **Before Paragraph** will insert code before `<tag>`, **After Paragraph** will insert code after closing `</tag>`.
|
142 |
+
**After Paragraph** will not work if you specify tag names that have no closing tags! Use # as tag if paragraphs have no tags and are separated with the `\r\n\r\n` characters.
|
143 |
+
|
144 |
+
Minimum number of paragraphs / Minimum page/post words: do not display ad if the number of paragraphs or the number of words is below limit (used only for position Before or After selected paragraph).
|
145 |
+
|
146 |
+
Display only for posts published after N days checks the date when the post was published.
|
147 |
|
148 |
On the Ad Inserter settings page (tab #) you also have option Tag Debugging. If enabled, it displays paragraph tags surrounded with a border. This way you can check where your code will be inserted. You can select to show paragraph tags before or after plugin processing. If Before Processing is selected Ad Inserter WILL NOT insert any code!
|
149 |
|
150 |
Additional Display Options:
|
151 |
|
152 |
+
* Manual - Insert shortcode `[adinserter block="BLOCK_NUMBER"]` or `[adinserter name="BLOCK_NAME"]` into post or page HTML code to display block with BLOCK_NAME name or BLOCK_NUMBER number at this position.
|
|
|
153 |
* PHP function call `<?php if (function_exists ('adinserter')) echo adinserter (BLOCK_NUMBER); ?>` - Insert code block BLOCK_NUMBER at any position in template file. With PHP function call counter (Excerpt/Post number) you can also define which call(s) to the function will actually insert code.
|
154 |
This is useful if you put a call to the `adinserter` function inside a loop in a template file (e.g. for homepage) and you need to insert ads only few times between posts.
|
155 |
|
156 |
+
Additional Options for code blocks:
|
157 |
+
|
158 |
+
PHP processing: Enabled or Disabled - Enable processing of PHP code. If there is an error in the PHP code, it will not break the website.
|
159 |
|
160 |
* Use {category}, {short_category}, {title}, {short_title}, {tag}, {smart_tag} or {search_query} tags to insert actual post data into code blocks
|
161 |
* Use {author} for post author username or {author_name} for post author name to insert post author data into code blocks (**works only inside posts**)
|
162 |
+
* To rotate different ad versions separate them with `|rotate|` - Ad Inserter will randomly select one of the ads
|
163 |
|
164 |
+
WARNING: If you are using caching ad rotation may not work as expected. It works only when the page is generated and Ad Inserter is called. In such cases please make sure you have disabled caching when you are using |rotate|.
|
165 |
|
166 |
+
Ad Inserter is perfect for displaying any kind of ads. It can also be used to display various versions of ad, for example <a href="https://support.google.com/adsense/answer/65083?ctx=as2&rd=2&ref_topic=23389" target="_blank">AdSense ads using channels</a> to test which format or color combination performs best.
|
|
|
|
|
167 |
|
168 |
+
**Lists**
|
169 |
+
|
170 |
+
Do not display ads in certain caregories e.g sport, news, science,... (black list) or display ads only in certain categories (white list):
|
171 |
+
leave category list empty and set it to Black list to show ads in all categories.
|
172 |
+
**WARNING:** If category name contains commas use category slug instead. Also make sure you have enabled display on **Category pages**.
|
173 |
+
|
174 |
+
Do not display ads in posts with certain tags (black list) or display ads only in posts with certain tags (white list). Leave tag list empty and set it to Black list to show ads for all tags. Also make sure you have enabled display on **Archive pages**.
|
175 |
+
|
176 |
+
Do not display ads on pages with certain urls (black list) or display ads only pages with certain urls (white list): leave url list empty and set it to Black list to show ads on all urls.
|
177 |
+
Url used here is everything starting form the `/` after the domain name. For example: if web address is `http://domain.com/lorem-ipsum`, url to white/black-list is `/lorem-ipsum`
|
178 |
+
You can also use partial urls with *. To filter all urls starting with /url-start use `/url-start*`, to filter all urls that contain url-pattern use `*url-pattern*`, to filter all urls ending with url-end use `*url-end`.
|
179 |
+
**WARNING:** Separate urls with SPACES.
|
180 |
+
|
181 |
+
Do not display ads to users from certain referers (domains) e.g technorati.com, facebook.com,... (black list) or display ads only for certain referrers (white list): use # for no referer (direct visit),
|
182 |
+
leave referrers list empty and set it to Black list to show ads for all referrers.
|
183 |
+
|
184 |
+
**WARNING:** If you are using caching, referer check may not work as expected. It works only when the page is generated and Ad Inserter is called. Make sure you have disabled caching when you are using such settings.
|
185 |
|
186 |
+
**Devices**
|
187 |
|
188 |
**IMPORTANT:** There are two types of device detection: **server side** and **client-side**.
|
189 |
|
197 |
|
198 |
**PLEASE NOTE:** In most cases you should use **ONLY client-side** detection type. Works perfectly with responsive designs as they use CSS media queries.
|
199 |
|
200 |
+
**BUT BE CAREFUL:** Some ad networks (like AdSense) limit ads per page. The ads are still inserted (loaded and counted) for all devices, but for unwanted devices they are hidden by the browser using CSS media queries based on viewport widths.
|
201 |
+
|
202 |
+
Up to 3 viewport names and widths can be defined on the Ad Inserter Settings tab # (<a href="http://tinymonitor.com/ad-inserter-pro" target="_blank">Ad Inserter Pro</a> supports up to 6 viewports). Default values are:
|
203 |
|
204 |
* Desktop: 980 pixels or more
|
205 |
* Tablet: from 768 pixels to 979 pixels
|
216 |
* Desktop and phone devices
|
217 |
|
218 |
**Server-side** detection of mobile/desktop devices works only when Ad Inserter plugin is called. It is called by Wordpress when it needs to generate a page. However, when you are using caching, it saves created page for quicker serving.
|
219 |
+
In such cases **the user might get (saved) page for wrong device** (used by some previous visitor who triggered page caching). To solve this issue use themes that generate separate pages for desktop and mobile devices or use Mobile Theme Switcher plugin.
|
220 |
Server-side detection uses User-Agent string combined with specific HTTP headers to detect the environment.
|
221 |
|
222 |
+
**PLEASE NOTE:** Use server-side device type detection only when you need to generate (display and count) ONLY code blocks for specific device type. In all other cases switch it off.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
|
224 |
+
By default code blocks will not be inserted on Error 404 page (Page Not Found). Check Error '404 Page checkbox' to enable code block on error 404 page.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
+
**Ad Inserter Settings - Tab #**
|
227 |
|
228 |
+
Wrapping divs for code blocks have 'code-block' and 'code-block-N' classes which can be used for custom styles. Class name 'code-block' can be changed in Ad Inserter settings. If you are using client-side device detection (CSS media queries) then the wrapping div for the code block will have also some of the following classes: ai-viewport-1, ai-viewport-2, ai-viewport-3.
|
229 |
|
230 |
+
You can choose between many syntax highlighting themes.
|
|
|
|
|
|
|
231 |
|
232 |
+
By default Ad Inserter exceptions on posts/pages are enabled only for administrators. You can define minimum user role for page/post Ad Inserter exceptions editing in Ad Inserter Settings (tab #).
|
233 |
|
234 |
+
Default Ad Inserter plugin processing order is 99999. It is used to specify the order in which the plugin functions are executed. Lower numbers correspond with earlier execution. You can change this value if you have problems with the processing order of other plugins.
|
235 |
|
236 |
+
If Paragraph Tag Debugging is enabled, it displays paragraph tags surrounded with a border. This way you can check where your code will be inserted. You can select to show paragraph tags before or after plugin processing. If Before Processing is selected Ad Inserter WILL NOT insert any code!
|
237 |
|
238 |
Support for Special Code Blocks:
|
239 |
|
240 |
+
* Header scripts (scripts in the `<header>` section)
|
241 |
+
* Footer scripts (scripts before the `</body>` tag)
|
|
|
|
|
242 |
|
|
|
|
|
|
|
|
|
|
|
243 |
|
244 |
**WARNING:** Text selection, Copy and Paste functions with the syntax highlighting editor do not work on mobile devices. If you need these functions you can temporarily swich to **Simple editor** using the checkbox above the code box.
|
245 |
|
256 |
If you experience problems with the Ad Inserter plugin you can ask for help on the <a href ="https://wordpress.org/support/plugin/ad-inserter">support forum</a>.
|
257 |
However, in order to be able to diagnose the problem and suggest actions or fix a bug, please do the following:
|
258 |
|
259 |
+
Check source code of the page. Some code for ads may not display anything, either because of errors in the ad code or because of ad network issues.
|
260 |
+
Before you report problem please check source code of the page and make sure the code is not inserted where it should be. The code may be inserted properly but you won't see anything.
|
261 |
+
Try to add some text after the ad code to check if it appears at the expected ad position. If you are sure that there is something wrong **you need to provide the following**:
|
262 |
|
263 |
1. Clear description of the problem. Describe what does not work as expected.
|
264 |
|
278 |
1. Download the plugin,
|
279 |
2. Go to Wordpress Plugins, Add New, Upload Plugin
|
280 |
3. Choose file, click on Install Now, activate it
|
281 |
+
3. Go to Settings / Ad Inserter to configure it
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
|
283 |
**WARNING:** Some adblockers may block Ad Inserter settings page. If you don't see normal tabs for code blocks or there is no save button, make sure you have whitelisted Ad Inserter settings page.
|
284 |
|
292 |
Before you report problem please check source code of the page and make sure the code is not inserted where it should be.
|
293 |
The code may be inserted properly but you won't see anything. Try to add some text after the ad code to check if it appears at the expected ad position.
|
294 |
|
295 |
+
**Ad Inserter Pro Installation**
|
296 |
+
|
297 |
+
<a href="http://tinymonitor.com/ad-inserter-pro" target="_blank">Ad Inserter Pro</a> is an upgraded version of the freely available Ad Inserter.
|
298 |
+
In addition to all the features in the free version it offers 64 code blocks, 6 custom viewports, export and import of settings and support via email.
|
299 |
+
|
300 |
+
If you are using free Ad Inserter simply uninstall it. The Pro version will automatically import existing settings from the free version.
|
301 |
+
After you receive the email with download link for the Ad Inserter Pro plugin, download it, go to Wordpress Plugins, Add New, Upload Plugin, Choose file, click on Install Now,
|
302 |
+
activate it and then click "Enter License Key" and enter license key you got in the email. If you need to edit license key go to Ad Inserter settings (tab #).
|
303 |
+
|
304 |
== Frequently Asked Questions ==
|
305 |
|
306 |
= I have activated Ad Inserter. How can I use it? =
|
365 |
* Tags: Cars, White List checked
|
366 |
|
367 |
|
368 |
+
= I wish to show ads side by side but not in the same block. How do I do this? =
|
369 |
+
|
370 |
+
Configure block 1 and 2 with ads using:
|
371 |
+
|
372 |
+
* Automatic Display: None
|
373 |
+
* Block Alignment and Style: No Wrapping
|
374 |
+
* Enable shortcode: checked
|
375 |
+
|
376 |
+
Configure block 3 with
|
377 |
+
|
378 |
+
`[adinserter block="1"]
|
379 |
+
[adinserter block="2"]`
|
380 |
+
|
381 |
+
Use block 3 to display ads and make sure all 3 blocks are enabled for the same page types (Posts, Pages, Homepage, etc.).
|
382 |
+
|
383 |
+
|
384 |
= How can I replace deprecated tags {adinserter n} for manual insertion with new ones [adinserter block="n"] in all posts? =
|
385 |
|
386 |
Use <a href="https://wordpress.org/plugins/search-regex/" target="_blank">Search Regex</a> plugin to replace tags in all posts with few clicks. If you are not familiar with regular expressions simply use search and replace text for each code block. Use **Replace** to test replacements and when it works as expected use **Replace & Save**.
|
387 |
|
388 |
|
389 |
+
= How can I add some text or title (e.g. Advertisement) above the ad? =
|
390 |
+
|
391 |
+
If this is a sidebar widget then you can simply name the widget.
|
392 |
+
|
393 |
+
In other cases you can add title HTML code above ad code. For example:
|
394 |
+
|
395 |
+
`<h3>Advertisement</h3>
|
396 |
+
|
397 |
+
AD_CODE`
|
398 |
+
|
399 |
+
Change title tag according to the theme style.
|
400 |
+
|
401 |
+
|
402 |
+
= How can I enable/disable ads on specific posts/pages? =
|
403 |
+
|
404 |
+
There are two possible approaches.
|
405 |
+
|
406 |
+
* Approach with page/post exceptions - use this one if there are many exceptions:
|
407 |
|
408 |
1. Go to Ad Inserter settings page and define default display options for post/page.
|
409 |
2. Enable automatic display on posts/pages and choose default display: **On all**, **On all except selected** or **Only on selected**.
|
411 |
4. Check default display options for wanted code blocks.
|
412 |
5. Set exceptions for this post or page.
|
413 |
|
414 |
+
* Approach with code block settings only - use this one if there are only few exceptions:
|
415 |
+
|
416 |
+
1. Go to Ad Inserter settings page and define default display options for post/page.
|
417 |
+
2. Enable automatic display On all Posts/Pages.
|
418 |
+
3. Click on Lists, enter url (or space separated urls) for Urls, e.g. `/permalink-url`, and white-list or black-list it.
|
419 |
+
|
420 |
|
421 |
= I'm using responsive theme. How can I show or hide some ads on mobile devices? =
|
422 |
|
605 |
|
606 |
== Screenshots ==
|
607 |
|
608 |
+
1. Settings for one code block (Widget). Up to 16 blocks can be configured (up to 64 in <a href="http://tinymonitor.com/ad-inserter-pro" target="_blank">Ad Inserter Pro</a>)
|
609 |
2. Settings for one code block (Before Paragraph)
|
610 |
3. Alignment **Left**, **None** - None means default (usually left) aligned ad block with thin margin around
|
611 |
4. Alignment **Right** - Right aligned ad block with thin margin around
|
620 |
|
621 |
== Changelog ==
|
622 |
|
623 |
+
= 1.6.7 =
|
624 |
+
- Bug fix: Block code textarea was not escaped
|
625 |
+
- Added checks for page types for shortcodes
|
626 |
+
- Added support for Before/After Post position call counter/filter
|
627 |
+
- Few minor cosmetic changes
|
628 |
+
|
629 |
= 1.6.6 =
|
630 |
- Bug fix: Display on Homepage and other blog pages might get disabled - important if you were using PHP function call or shortcode (import of settings from 1.6.4)
|
631 |
- Few minor cosmetic changes
|
816 |
|
817 |
== Upgrade Notice ==
|
818 |
|
819 |
+
= 1.6.7 =
|
820 |
+
Bug fix: Block code textarea was not escaped;
|
821 |
+
Added checks for page types for shortcodes;
|
822 |
+
Added support for Before/After Post position call counter/filter;
|
823 |
+
Few minor cosmetic changes
|
824 |
+
|
825 |
= 1.6.6 =
|
826 |
Bug fix: Display on Homepage and other blog pages might get disabled - important if you were using PHP function call or shortcode (import of settings from 1.6.4)
|
827 |
Few minor cosmetic changes;
|
1004 |
= 1.0.0 =
|
1005 |
Initial release
|
1006 |
|
1007 |
+
|
screenshot-1.jpg
CHANGED
Binary file
|
screenshot-10.jpg
CHANGED
Binary file
|
screenshot-2.jpg
CHANGED
Binary file
|
settings.php
CHANGED
@@ -60,10 +60,11 @@ function generate_settings_form (){
|
|
60 |
<?php
|
61 |
if (function_exists ('ai_settings_header')) ai_settings_header (); else { ?>
|
62 |
<div style="float: right; text-align: right; margin: 8px 18px 0px 0;">
|
63 |
-
If you find
|
64 |
</div>
|
65 |
<div style="float: right; text-align: right; margin: 0px 18px 0px 0;">
|
66 |
-
|
|
|
67 |
</div>
|
68 |
<h2><?php echo AD_INSERTER_TITLE . ' ' . AD_INSERTER_VERSION ?></h2>
|
69 |
<?php
|
@@ -212,7 +213,7 @@ function generate_settings_form (){
|
|
212 |
</div>
|
213 |
|
214 |
<div style="padding:8px;">
|
215 |
-
<textarea id="block-<?php echo $ad_number; ?>" name="<?php echo AI_OPTION_CODE, WP_FORM_FIELD_POSTFIX, $ad_number; ?>" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold; width: 719px; height: 384px;"><?php echo
|
216 |
</div>
|
217 |
|
218 |
<div style="padding:8px 8px 8px 16px;">
|
@@ -423,7 +424,7 @@ function generate_settings_form (){
|
|
423 |
</div>
|
424 |
|
425 |
<div id="blog-page-settings-<?php echo $ad_number; ?>" style="padding: 8px 8px 8px 8px; margin: 8px 0 8px 5px; border: 1px solid #ddd; border-radius: 5px;">
|
426 |
-
Excerpt/Post number(s) <input style="border-radius: 5px;" type="text" name="<?php echo AI_OPTION_EXCERPT_NUMBER, WP_FORM_FIELD_POSTFIX, $ad_number; ?>" value="<?php echo $obj->get_excerpt_number() ?>" title= "
|
427 |
</div>
|
428 |
|
429 |
<div style="margin: 8px 0 8px 5px; padding:8px; border: 1px solid #ddd; border-radius: 5px;">
|
@@ -575,10 +576,11 @@ function generate_settings_form (){
|
|
575 |
<div style="clear: both;"></div>
|
576 |
|
577 |
<div style="padding:0px 0px 8px 16px;">
|
578 |
-
Tag Debugging:
|
579 |
|
580 |
<select
|
581 |
style="border-radius: 5px; width:150px"
|
|
|
582 |
id="tag_debugging"
|
583 |
name="tag_debugging"
|
584 |
value="Value">
|
@@ -646,7 +648,7 @@ function generate_settings_form (){
|
|
646 |
HTML / Javascript / CSS / PHP code
|
647 |
</div>
|
648 |
<div style="padding: 8px;">
|
649 |
-
<textarea id="block-h" name="<?php echo AI_OPTION_CODE, '_block_h'; ?>" rows="36" cols="98" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold; width: 719px; height: 384px;"><?php echo
|
650 |
</div>
|
651 |
</div>
|
652 |
|
@@ -685,7 +687,7 @@ function generate_settings_form (){
|
|
685 |
HTML / Javascript / PHP code
|
686 |
</div>
|
687 |
<div style="padding:8px;">
|
688 |
-
<textarea id="block-f" name="<?php echo AI_OPTION_CODE, '_block_f'; ?>" rows="36" cols="98" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold; width: 719px; height: 384px;"><?php echo
|
689 |
</div>
|
690 |
</div>
|
691 |
|
60 |
<?php
|
61 |
if (function_exists ('ai_settings_header')) ai_settings_header (); else { ?>
|
62 |
<div style="float: right; text-align: right; margin: 8px 18px 0px 0;">
|
63 |
+
If you find Ad Inserter useful, please write a nice review on the <a style="text-decoration: none;" href="https://wordpress.org/support/view/plugin-reviews/ad-inserter" target="_blank">Plugin Reviews</a> page.
|
64 |
</div>
|
65 |
<div style="float: right; text-align: right; margin: 0px 18px 0px 0;">
|
66 |
+
<a style="text-decoration: none;" href="http://tinymonitor.com/ad-inserter-pro" target="_blank">Go Pro</a> if you need more than 16 blocks
|
67 |
+
or <a style="text-decoration: none;" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4" target="_blank">donate</a> to support free Ad Inserter development.
|
68 |
</div>
|
69 |
<h2><?php echo AD_INSERTER_TITLE . ' ' . AD_INSERTER_VERSION ?></h2>
|
70 |
<?php
|
213 |
</div>
|
214 |
|
215 |
<div style="padding:8px;">
|
216 |
+
<textarea id="block-<?php echo $ad_number; ?>" name="<?php echo AI_OPTION_CODE, WP_FORM_FIELD_POSTFIX, $ad_number; ?>" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold; width: 719px; height: 384px;"><?php echo esc_textarea ($obj->get_ad_data()); ?></textarea>
|
217 |
</div>
|
218 |
|
219 |
<div style="padding:8px 8px 8px 16px;">
|
424 |
</div>
|
425 |
|
426 |
<div id="blog-page-settings-<?php echo $ad_number; ?>" style="padding: 8px 8px 8px 8px; margin: 8px 0 8px 5px; border: 1px solid #ddd; border-radius: 5px;">
|
427 |
+
Excerpt/Post number(s) <input style="border-radius: 5px;" type="text" name="<?php echo AI_OPTION_EXCERPT_NUMBER, WP_FORM_FIELD_POSTFIX, $ad_number; ?>" value="<?php echo $obj->get_excerpt_number() ?>" title= "Filter insertions by specifying calls for this position - single number or comma separated numbers, 0 means all / no limits" size="10" maxlength="20" /> on blog pages (also filter for Before/After Post and PHP function calls)
|
428 |
</div>
|
429 |
|
430 |
<div style="margin: 8px 0 8px 5px; padding:8px; border: 1px solid #ddd; border-radius: 5px;">
|
576 |
<div style="clear: both;"></div>
|
577 |
|
578 |
<div style="padding:0px 0px 8px 16px;">
|
579 |
+
Paragraph Tag Debugging:
|
580 |
|
581 |
<select
|
582 |
style="border-radius: 5px; width:150px"
|
583 |
+
title="When enabled, individual post paragraphs will be surrounded with a border for easier identification and ad placement."
|
584 |
id="tag_debugging"
|
585 |
name="tag_debugging"
|
586 |
value="Value">
|
648 |
HTML / Javascript / CSS / PHP code
|
649 |
</div>
|
650 |
<div style="padding: 8px;">
|
651 |
+
<textarea id="block-h" name="<?php echo AI_OPTION_CODE, '_block_h'; ?>" rows="36" cols="98" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold; width: 719px; height: 384px;"><?php echo esc_textarea ($adH->get_ad_data()); ?></textarea>
|
652 |
</div>
|
653 |
</div>
|
654 |
|
687 |
HTML / Javascript / PHP code
|
688 |
</div>
|
689 |
<div style="padding:8px;">
|
690 |
+
<textarea id="block-f" name="<?php echo AI_OPTION_CODE, '_block_f'; ?>" rows="36" cols="98" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold; width: 719px; height: 384px;"><?php echo esc_textarea ($adF->get_ad_data()); ?></textarea>
|
691 |
</div>
|
692 |
</div>
|
693 |
|