Why don't I see a widget in WordPress?

Good time of day.

Pull the HTML for a WordPress theme for example.
Came to the field of widgets and hung. Like all did correctly, but alas, the widget is not displayed.
Attach all information:
index.php
<?php
get_header();
?>

<div id="contentColumn">
 <?php if(have_posts()) : while(have_posts()) : the_post(); ?>

 <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

 <div class="divider"></div>

 <?php the_content(); ?>
 <?php endwhile; else : ?>

 <?php _e( 'Sorry, no posts were found.' ); ?>

<?php endif; ?>
</div>

<?php get_sidebar(); ?>

<?php
get_footer();
?>

functions.php
<?php

if ( function_exists( 'register_sidebar' ) ) {
register_sidebar( array (
'name' =--> __( 'Primary Sidebar', 'primary-sidebar' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area', 'dir' ),
'before_widget' => '<div class="subHeader">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>', )
);
}

?>

sidebar.php
<div id="navColumn">
 <div class="subHeader"><h3>Popular Articles</h3></div>
the <ul>
 the <li><a href="#">How to design</a></li>
 the <li><a href="#">What is a WYSIWYG</a></li>
 the <li><a href="#">How to SEO</a></li>
 the <li><a href="#">XHTML 1.0 Strict</a></li>
 the <li><a href="#">Why use a computer</a></li>
 the <li><a href="#">What the hell</a></li>
</ul>

 <div class="subHeader"><h3>Some Friends</h3></div>
the <ul>
 the <li><a href="#">John's Blog</a></li>
 the <li><a href="#">Bryant Smith</a></li>
 the <li><a href="#">Richie Johnson</a></li>
 the <li><a href="#">Ericka's Vlog</a></li>
 the <li><a href="#">Justin Ramos' site</a></li>
 the <li><a href="#">Vi Chin Home</a></li>
</ul>

 <div class="subHeader"><h3>External Links</h3></div>
the <ul>
 the <li><a href="#">Google</a></li>
 the <li><a href="#">Digg</a></li>
 the <li><a href="#">Yahoo</a></li>
 the <li><a href="#">ASZX</a></li>
 the <li><a href="#">Reddit</a></li>
</ul>

 <div class="subHeader"><h3>Advertisers</h3></div>
the <ul>
 the <li><a href="#">Sold</a></li>
 the <li><a href="#">Selling</a></li>
 the <li><a href="#">Ten dollars</a></li>
</ul>
</div>

A screenshot of the admin
5a2ff27324084225488814.png
A screenshot of the result
5a2ff277d72fb836321943.png


Please help.
All beaver and key 13.
June 10th 19 at 15:47
1 answer
June 10th 19 at 15:49
Solution
So you have to sidebar.php nothing.
https://developer.wordpress.org/themes/functionali...
Thank you. First added the get_sidebar argument with the name of the sidebar file functions.php - nothing happened.
Then read that article and decided to change get_sidebar on dynamic_sidebar('primary-sidebar') and wound up.
index.php
<?php
get_header();
?>

<div id="contentColumn">
 <?php if(have_posts()) : while(have_posts()) : the_post(); ?>

 <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

 <div class="divider"></div>

 <?php the_content(); ?>
 <?php endwhile; else : ?>

 <?php _e( 'Sorry, no posts were found.' ); ?>

<?php endif; ?>
</div>

<div id="navColumn">
 <?php dynamic_sidebar('primary-sidebar'); ?>
</div>

<?php
get_footer();
?>

- Zelma_Block5 commented on June 10th 19 at 15:52

Find more questions by tags WordPress