WP Manifestindependent plugin directory
manifest / utilities / banners-config

Banners Config

Managing advertising banners through the configuration file wp-content/banners-config.php using files from the WordPress media library

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/masterforweb/banners-config/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Wordpress Ads plugin

License: GPLv3
License URI: GPL-3.0

Установка

  • Склонировать или распаковать в папку wp-content/plugins/banners-config
  • Активировать Banners Config в разделе плагинов WordPress
  • При активации плагина будет создан файл конфигурации в wp-content/banners-config.php
  • Заполните данные баннера в таком формате:
'test_240x400' => [ # любое удобное название
    'id' => 1, # id в Медиатеке WordPress
    'url' => '', # ссылка для перехода (необязательный)
    'erid' => '', # маркеровка рекламы (необязательный), при заполнении параметра erid в url не указывать
    'width' => 240, # ширина файла (необязательный)
    'height' => 400, # высота файла (необязательный)
    'active' => 1 # 0 - выключить, 1 - включить (необязательный)
],

Использование в коде

С проверкой установленного плагина

if (function_exists( 'banners_conf_display' )){
   banners_conf_display( 'test_240x400' );
}

Более легкий, но небезопасный код. При отключении плагина сайт может выдавать 500 ошибку

<?php banners_conf_display( 'test_240x400' );?>

Cамый компактный код (небезопасный)

<?banners_conf_display('test_240x400')?>