A
A
Artyom Arutyunyann2020-05-22 03:22:34
WordPress
Artyom Arutyunyann, 2020-05-22 03:22:34

How to make a sidebar in wordpress?

Hello, I have a problem rather than a question, I included a sidebar in the functions.php file

add_action( 'widgets_init', 'register_my_widgets' );
function register_my_widgets(){
  register_sidebar( array(
    'name'          => "Left Sidebar",
    'id'            => "left_sideBar",
    'description'   => 'Описание сайт бара'
  ) );
}

added php code in sidebar.php file in wordpress in appearance section widget subsection appeared BUT when i insert a widget ( any ), it is not saved and displayed on the site ( moved to "Inactive Widgets" section), what should i do please help PS I’m not sure if this is important or not, but I didn’t install any plugins, the wordPress version is like 4.9.1 if I remember correctly, there is 5.4.1, I tried it on it, too. Thanks
<?php dynamic_sidebar('left_sideBar'); ?>



Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
QuestYouCraft, 2020-05-22
@Casper335

SideBar is connected in the WordPress admin panel (Themes --> Customize --> Widgets --> Add SideBar)
This is different for each theme, so you should look at the documentation for your theme on this topic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question