Как закрыть в WordPress недостающие закрывающие теги через хук в записях

Порой при парсинге на сайт возникает поломка верстки (например сайдбар “падает” под запись) и не обходимо закрыть теги во всех статьях (и подумать о следующих)
Моно воспользоваться плагином замены, а можно через хук закрыть все теги.





add_filter('the_content', function($content) {
    if (is_singular('post')) { // ← именно 'post'
        return force_balance_tags($content);
    }
    return $content;
});


guest
Другие сообщения форума
Закрыть меню
ZAPLATA.RU | Магазин готовых блогов Wordpress с автонаполнением
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.