A
A
altkov2021-09-14 19:49:19
WordPress
altkov, 2021-09-14 19:49:19

How to change widget title html in WordPress (before_title doesn't work at all)?

The function register_sidebarcreates a sidebar with arguments before_titleand after_title, divs. At the front, in the headers of this sidebar, standard h2. It's not divs that come to my widget anymore, but these h2. Why? How to change it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-16
@artzolin

I copied your code from the comment, pasted it into a clean theme, everything works fine
6142903ead81f012952865.png

register_sidebar(
        array(
            'name'          => 'Сайдбар каталога',
            'id'            => 'catalog-sidebar',
            'description'   => 'Сайдбар для каталога',
            'before_widget' => '<div class="catalog-sidebar-section %2$s" id="%1$s">',
            'after_widget'  => '</div>',
            'before_title'  => '<div class="catalog-sidebar-header">',
            'after_title'   => '</div>',
        )
    );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question