• With this code, I activated three widget areas for the site template:

    <?php
    function arphabet_widgets_init()
    {
    
        register_sidebar(
            array(
                'name' => 'سایدبار سمت چپ',
                'id' => 'sidebar_left',
                'description' => esc_html__('این سایدبار سمت چپ صفحه قرار میگیرد و محل نمایش کل صفحات وردپرس به جز صفحه برگه و محصولات', 'i-theme-one'),
                'before_widget' => '<div id="%1$s" class="w-theme widget-left %2$s">',
                'after_widget' => '</div>',
                'before_title' => '<h4 class="widget-title">',
                'after_title' => '</h4>',
            )
        );
        register_sidebar(
            array(
                'name' => ('سایدبار سمت راست'),
                'id' => 'sidebar_right',
                'description' => esc_html__(
                    'این سایدبار فقط در صفحه اصلی و سمت راست قرار میگیرد و فقط میتوانید عکس اضافه کنید .',
                    'i-theme-one'
                ),
                'before_widget' => '<div id="%1$s" class="w-theme widget-img %2$s">',
                'after_widget' => '</div>',
                'before_title' => '<h4 class="widget-title">',
                'after_title' => '</h4>',
            )
        );
        register_sidebar(
            array(
                'name' => ('سایدبار محصولات'),
                'id' => 'woo_sidebar_right',
                'description' => esc_html__('این سایدبار فقط در صفحات آرشیو محصولات نمایش داده میشود .', 'i-theme-one'),
                'before_widget' => '<div id="%1$s" class="w-theme widget-woo %2$s">',
                'after_widget' => '</div>',
                'before_title' => '<h4 class="widget-title">',
                'after_title' => '</h4>',
            )
        );
    
    }
    add_action('widgets_init', 'arphabet_widgets_init');
    
    ?>
    

    But when I go to WordPress widgets, nothing is displayed

    translate by google

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Imagethreadi

    (@threadi)

    I see all 3 in my installation, both with classic themes and with the modern ones. Which theme are you using?

    Thread Starter Imageithemeir

    (@ithemeir)

    @threadi ,I am designing and coding my own template

    I put the widget activation code in the function file, but nothing is displayed in the widget section
    Also, I brought the previous templates that I had designed and installed them in WordPress 6.5. I tested them and saw that the widget section is empty.
    But it increases in WordPress 6.4

    Moderator Imagethreadi

    (@threadi)

    What kind of theme are you developing? A classic or a block theme?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Activating the widget section in WordPress 6.5’ is closed to new replies.