Skip to main content
4 of 6
added 731 characters in body

get_sidebar() will not work in footer.php

I moved get_sidebar(); from header.php to footer.php but it simply does not appear is being placed after the last post instead of in the footer. There are no errors displayed. What do I need to do to get this working?

functions.php

/**
 * Register widget area.
 *
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
 */
function isometricland_widgets_init() {
    register_sidebar( array(
        'name'          => esc_html__( 'Sidebar', 'isometricland' ),
        'id'            => 'sidebar-1',
        'description'   => esc_html__( 'Add widgets here.', 'isometricland' ),
        'before_widget' => '<section id="%1$s" class="widget %2$s">',
        'after_widget'  => '</section>',
        'before_title'  => '<h2 class="widget-title">',
        'after_title'   => '</h2>',
    ) );
}
add_action( 'widgets_init', 'isometricland_widgets_init' );

footer.php

<?php
    global $path_root;
?>
                </main>
                <!-- END PAGE CONTENTS -->
                <!-- START FOOTERS -->
                <footer>
                    <div id="footframe">
                    </div>
<?php wp_footer(); //Crucial footer hook! ?>
                </footer>
                <!-- END FOOTERS -->
            </div>
            <!-- END MIDDLE PANE -->
            <!-- START SIDEBAR -->
            <div id="leftframe">
                <div id="sidebarframetop">
                    <div id="sidebar_widget">
<?php get_sidebar(); ?>
                    </div>
                </div>
            </div>
            <!-- END SIDEBAR -->
        </div>
    </body>
</html>

The rendered HTML:

<aside id="secondary" class="widget-area">
    <section id="meta-2" class="widget widget_meta"><h2 class="widget-title">Meta</h2>
        <ul>
            <li><a href="blog/wp-login.php?action=register">Register</a></li>           <li><a href="https://isometricland.net/blog/wp-login.php">Log in</a></li>
            <li><a href="blog/feed/">Entries feed</a></li>
            <li><a href="blog/comments/feed/">Comments feed</a></li>

            <li><a href="https://wordpress.org/">WordPress.org</a></li>
        </ul>
    </section>
</aside>