Move custom sidebar out of in Twenty Twenty-One child theme


In the child theme, I registered a widget area for a sidebar that I only want to show on single posts.

In my single.php, in between the endwhile; and get_footer();, I added:

echo '<aside id="primary" class="post-sidebar">';
    dynamic_sidebar( 'Post Sidebar' ); 
echo '</aside>'; 

It is outputting inside the <main>. How can I move it outside of Main to show before the footer?

Christina 1 year 2022-06-20T17:00:50-05:00 0 Answers 0 views 0

Leave an answer