Ad Rotator — это простой виджет для WordPress, позволяющий отображать в боковой панели случайный код HTML из заданного набора блоков, разделенных <!--more-->. По сути он отображает разный HTML каждый раз, когда вы запрашиваете страницу. Количество блоков и экземпляров виджета неограничено.
Установка
-
Загрузите и распакуйте файлы плагина в каталог wp-content/plugins/ad-rotator/.
-
Включите плагин Ad Rotator на странице Plugins (Плагины) в Site Admin (Панель управления).
-
Зайдите на страницу Appearence/Widgets (Внешний вид/Виджеты) в Site Admin (Панель управления) и перетяните такое количество виджетов “Ad Rotator” в ваши боковые панели, которое вам нужно. Отредактируйте экземпляры виджетов, разделяя блоки кода с помощью
<!--more-->. Сохраните настройки.

-
Теперь виджеты Ad Rotator должны появится в ваших боковых панелях.
Миграция с плагина AdRotator
Плагин AdRotator — это простое решение для ротации рекламы, основанное на текстовых файлах. Он был разработан Angsuman Chakraborty очень давно, но по случайности мы использовали одинаковое название для плагина (с точки зрения WordPress). Если вы используете этот плагин, вы можете нажать ссылку “обновить” на странице Plugins, и он будет заменен виджетом Ad Rotator.
Итак, у вас есть два пути решения проблемы 'getad()' function is undefined:
-
Вы можете скачать плагин AdRotator и игнорировать все последующие нотификации о наличии новой версии, или
-
Вы можете обновить вашу тему для использования виджета Ad Rotator.
Как обновить тему для использования виджета? Найдите все вхождения функции getad, и замените их чем-то вроде:
1 2 3 4 5 6 7 8 | register_sidebar(array( 'name' => 'ad-area', 'id' => 'ad-area', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '' )); |
Убедитесь, что вы заменили ad-area на другое имя, более подходящее для вас. Кроме того, вы можете указать дополнительные настройки вроде before_title и after_title.
Теперь откройте страницу Appearence/Widgets (Внешний вид/Виджеты) в Site Admin (Панель управления) и настройте экземпляры виджета Ad Rotator для ваших рекламных блоков. Просто примите во внимание, что в файлах для AdRotator блоки рекламы разделены символом новой строки (то есть каждая строка означает отдельный рекламный блок), а для виджета Ad Rotator вы должны разделять блоки с помощью <!--more--> (поэтому каждый из них может содержать более одной строки).
В любом случае, парни, извините за путаницу. Я не хотел вас обманывать.
Требования
Для работы плагина требуется WordPress версии 2.8 или выше. Также убедитесь, что ваша тема поддерживает виджеты.
Загрузка
Последняя версия виджета “Ad Rotator” — 2.0.3, и она может быть загружена отсюда:
version2.0.3DownloadAd Rotator
Если у Вас есть предложения, Вы хотите оставить отзыв или нашли ошибки, пожалуйста, отпишитесь в комментариях. Это очень важно для меня!
Часто задаваемые вопросы
В. Как ввести несколько блоков рекламы в одно поле ввода?
О. Разделяйте ваши блоки с помощью последовательности <!--more-->.
В. Сколько блоков рекламы может содержать один экземпляр виджета?
О. Количество рекламных блоков неограничено.
В. Могу я использовать код Google AdSense code как один и блоков?
О. Конечно, вы можете использовать любые куски HTML, какие захотите (AdSense, Clicksor, Chitika, и все остальное).
В. WordPress показывает ошибку `’getad()’ function is undefined`
О. Смотрите объяснение в разделе Миграция с плагина AdRotator.
Список изменений
- 2.0.3 (July 30, 2009)
- Исправлена проблема с экранированием кавычек слешами внутри HTML (спасибо Maxx Kremer).
- 2.0.2 (July 29, 2009)
- Добавлен раздел Migrating from AdRotator plugin в readme.txt.
- 2.0.1 (29 июля 2009)
- Исправлен раздел “Installation” в readme.txt.
- Теперь HTML будет фильтроваться для пользователей, которые не имеют права редактировать неотфильтрованный HTML.
- 2.0.0 (29 июля 2009)
- Виджет польностью переписан с использованием нового API для виджетов, который появился в WordPress 2.8.
- Добавлены readme.txt и пара скриншотов.
- 1.0.1 (31 марта 2007)
- Обновлена домашняя страница плагина.
- 1.0.0 (1 мая 2006)
- Базовая реализация плагина.
Другие плагины
Полный список плагинов, которые я написал, можно найти здесь.

Hi. is there soemthing wrong witht he plugin?
After installing it wont let me activate it. is the version still compatible. im using wordpress 2.7.
I made this web site. It’s all about celebrity news and gossip…So I’d appreciate your opinion on web site, this ad widget sounds cool.
I’m getting the same “Fatal error: Cannot use string offset as an array” problem as Mimi above. It happens when I try to go to my “Widgets” page in wp-admin. It used to work fine, now it doesn’t. I tried erasing the data in Mysql but it didn’t work. Suggestions please? It was such a useful plugin.
I did a fresh install of wordpress 2.8 and when I go to add more ad-rotator widgets it won’t add anymore than just one. Any ideas on a quick fix?
Thanks
Right now I have 3 ad rotator widgets that are all working fairly well however, I want more. I have tried to request more using the “how many do you want” option but no matter how many I choose none appear. What am I doing wrong?
This widget doesn’t work in multi-mode in wp2.8 anymore, as they have changed the way widgets are created and coded from 2.8 and on:
http://codex.wordpress.org/Plugins/WordPress_Widgets_Api
Might want to update it and maybe, just maybe submit it to the WordPress Plugin database so we can find the updated version on there too… it would be a waste if you didn’t and left the widget here to die.
Prior to upgrading to WordPress 2.8, Ad Rotator had the option to select multiple instances of the plugin. Now the selection for multiple instances is still there but no additional Ad Rotators appear after choosing a number of extra copies. Is this something that can be tweaked in the plugin to make it compatible or is this a bug to be pursued at WordPress.org?
Hello?? Is this plugin going to be upgraded to work in multi-mode?
Great plugin, thank you very much for this!
Um.. I ran into that WP upgrade error because I am using the real AdRotator. You should change the name so your widget doesn’t do that.
Cole, I’m not sure that this is the best solution. This widget is more than 3 years old, so it has his own users, and I am not ready to stop providing them a good solution for this day-to-day problem.
Hi Dmytro,
Thanks for updating the plugin. This is a great plugin that I would be lost without!
Kudos to you!
I’m having an issue since the upgrade — backslashes are now appearing before all of my double-quotes and apostrophes.
Look in my sidebar under “Rave Reviews” to see what I mean.
2Ike: Fixed in 2.0.3
Where is 2.0.3? I just downloaded the plugin and it appears to still be 2.0.2 and still the same issue with backslashes.
Steve, I’ve updated links, so 2.0.3 could be downloaded now.
Thanks Dmytro! Greatly appreciated. Where is your PayPal donation link?
Hi,
Is there any way to stop the plugin from trying to escape quotes when you add some html? I am trying to add a banner image withing a link and it doesn’t show up because the plugin automatically escapes the quotes.
Regards,
How do I have the rotating ads show up in my Theme? I did not understand the directions. I created a TXT file with the HTML for images and links, and uploaded it to the wp-content folder. Is this method still used with this new version?
I just updated and I’ve had a few issues. First, the update essentially deleted all my existing rotators. Luckily I was planning on changing the ads anyway. Now, as I’m starting over, the rotators are showing multiple ads stacked on each other with (!–more–) between them.
Hi Dmytro, I must be pretty thick!!…I have finally been able to get the first image to appear, but the images won’t rotate. Can you please take a look at the code below and tell me what I am doing wrong? Thanks, Steve
<!–more–)
Hey Steve,
Could you contact me directly at kpumuk@kpumuk.info?
I have changed my code since last post as the images were all running in-line down the column…current code looks like this, but still no rotating…Regards, Steve
<!–more–)
Can I enter another web site widget code into the rotator? I’d like to enter widgets like weather and stuff and have them rotate. Thanks.
I’m getting this error when I try to activate the plugin:
Fatal error: Class ‘WP_Widget’ not found in /zine/wp-content/plugins/ad-rotator/adrotator.php on line 28
How might I go about fixing it?
Looks like you are using outdated WordPress version. You should update it to at least 2.8.0 to use this plugin. And I think you should do the upgrade, because there are many known security holes in old version, and your blog could be hacked by someone.
Thank you for your prompt response!
I’m using this plugin in all of my websites.. The beauty is this will decrease down the ad blindness and users tends to click more on ads..More over other benifit is I can keep track of CTR and check which ad is performing well and remove the non performer..
My Kudos to this pligin
I installed this plugin this morning because I was being prompted to upgrade from the old Ad Rotator plugin at http://blog.taragana.com/index.php/archive/wordpress-plugin-adrotator-rotate-your-ads-including-adsense-dynamically/
This plugin appears to do exactly what that one had done. The only difference between the two is that this one works in a widget whereas the old one worked with a template tag. I had gotten around the template tag issue when widgets were introduced by writing my own widget for the old plugin so I essentially had the same functionality on my website before I installed this one. And I have not had to update it for different WordPress versions (while this one seems to need updating occasionally). I’ll use this one for a while to see if there’s any real benefit to it but will probably switch back after a while.
And FYI – if you’re running the old version and want to keep it without getting prompted to upgrade to this one simply change the filename of the old one.
Having two plugins with the same name is bad enough, but making one rewriting over the other is very ugly thing in life. Having to redownload and reinstall the old one just because you thing widgets are nice is not appreciated.
[...] you find another theme that doesn’t include adsense, I’d recommend checking out the Ad Rotator. I haven’t tried it out, but it is supposed to be able to include ads into any WordPress [...]