DIVI conditional modules display

// This filter will be fired for every Divi section, row, column and module. By the way, internally
// for Divi a section is just another module so if we talk about modules below, this also includes
// sectios, rows, and columns.
add_filter(‘et_module_shortcode_output’, ‘my_custom_et_module_shortcode_output’, 10, 3);
function my_custom_et_module_shortcode_output($output, $render_slug, $module)
{
// First we check whether there are any CSS classes we could check for.
// If not, we can directly return the HTML of the module and are done.
if (!isset($module->props[‘module_id’]) || et_core_is_builder_used_on_current_request() ) {
return $output;
}

// Now we can check if one of our two classes «user_logged_in» or «user_not_logged_in»
// are present in the CSS classes and handle them accordingly.

// If the «user_logged_in» class is present, we also check if the user is logged in.
// If both conditions are met, we return the HTML of the module and if not, we
// return an empty string and omit therefore modules HTML. If you’re curios, the ? :
// is called a ternary operator and it’s just a shortform for a simple if statement. :)
if (strpos($module->props[‘module_id’], ‘sameday-banner’) !== false) {
return is_front_page() ? $output : »;
}

// And here we basically do the same for the «user_not_logged_in» class but this time, we
// use the not operator (!) to check that the user is not logged in. Simple, right? ;)
//if (strpos($module->props[‘module_id’], ‘user_not_logged_in’) !== false) {
// return !is_user_logged_in() ? $output : »;
//}

// Finally, if neither one of our classes is present in the modules CSS classes, we
// return the HTML of the module so it can be shown on the page.
return $output;
}

Настройка целей Google Analytics

  1. Если у вас analytics.js
    ga(‘send’, ‘event’, ‘КАТЕГОРИЯ’, ‘ДЕЙСТВИЕ’);
  2. Если у вас gtag.js
    gtag(‘event’, ‘НАЗВАНИЕ ЦЕЛИ’, { ‘event_category’: ‘КАТЕГОРИЯ’, ‘event_action’: ‘ДЕЙСТВИЕ’, });
  3. Для проброса через GTM
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
    ‘event’: ‘eventTracking’,
    ‘category’: ‘form’,
    ‘action’: ‘lid’,
    });Затем нужно в GTM настроить:
    — триггер eventTracking
    — пользовательские переменные уровня данных: category и action
    — создать тег Google Analytics с типом Событие и там указать ранее созданные переменные и триггер

Восстановление прошивки на роутере Asus RT-N66U (h/w B1)

Если обычное аварийное восстановление прошивки через Firmware Restoration не помогло:

1) Скачиваем файл прошивки с сайта ASUS.

2) Ставим на компьютере IP адрес 192.168.1.10, маску подсети 255.255.255.0. Остальное указывать не надо.

3) Очищаем NVRAM: на обесточенном роутере зажимаем кнопку WPS, подаём питание и ждём когда светодиодный индикатор питания быстро-быстро заморгает. Отпускаем кнопку WPS.

4) Включаем режим аварийного восстановления: снова обесточим роутер, зажмём кнопку Reset и подадим питание. Держим секунд 5-10, пока индикатор питания не заморгает с небольшой частотой.

5) Подключаем сетевым патч-кордом комп к любому из LAN-портов роутера.

6) В адресной строке браузера вбиваем 192.168.1.1. Откроется мини веб-сервер роутера. Скармливаем файл прошивки. Браузер по итогам скармливания сообщит что всё окей, система готовится к перезагрузке. На слово Continue можно не нажимать. После скармливания на роутере индикатор питания погаснет вообще, будет гореть почти непрерывно только индикатор линка на задействованном LAN-порту. И вот здесь нужно ждать минут 40, если не больше. Будет казаться, что ничего не происходит, но это не так. Не нужно трогать роутер и его питание. Ждите 40 минут.

7) Через 40 минут роутер запустится. Загорится индикатор питания, оба индикатора вай-фая, линк на локальном порту. Стоковая админка будет доступна по адресу 192.168.1.1

 

© https://dark-violator.livejournal.com/213144.html

Отключить Защитник Windows в Windows 10

Для того чтобы отключить навсегда Защитник Windows:

1. Перейдите к следующей ветви реестра:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender

2. Создайте параметр DWORD (32 бита) с именем DisableAntiSpyware и присвойте ему значение 1