In the WP template, a sidebar is connected via register_sidebar in the functions.php file.

In the same sidebar, you need to add another block with text and links of this type:

 <div id="block-goods"> <h2 class="block-goods-title"> <a href="http://link/">Title</a> </h2> <div class="block-goods-list"> <div>text</div> <a class="block-goods-img-link" href="http://link/"></a> </div> </div> 

I know how to statically add this block in the admin panel in the "Widgets" section.

How to add this block with the ability to edit text? And how to connect the link to the internal pages of the site in this block?

UPD

The site is already connected (registered) sidebar. I need to add a new block with text and links to it. And it is also necessary that this block be displayed only on the main page.

Previous sidebar created in sidebar.php:

 <div id="right-column"> <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar1') ) : ?> <?php endif; ?></div> 

and connected to index.php like this:

 <div class="sidebar" id="sideRight"> <?php get_sidebar(); ?> </div> 
  • Not quite catching up what you want to do. You have a registered sidebar, respectively, it has a template. Through the admin panel you can add this html to the text widget. And what's wrong, add and edit the text - eugene_v
  • How to make this block appear only on the first page? or need another sidebar to create? - Marina Voronova
  • Here you need to look, well, or you can register a new one with the necessary parameters - eugene_v

1 answer 1

See how a sidebar is registered, can it help you solve the problem https://codex.wordpress.org/Function_Reference/register_sidebar