How to publicly display the custom HTML widget?

Question

I’m on the latest version of WordPress as of 2021/05/16, version 5.7.2, using the free Astra theme. Within my child theme, I have a custom sidebar I created to hold my widgets…

Sidebar


    function _ac_register_sidebars() {

            register_sidebar(
                apply_filters(
                    '_ac_footer_columns_widgets_init',
                    array(
                        'name'          => esc_html__( 'Footer Columns', '_ac' ),
                        'id'            => 'footer-columns',
                        'description'   => esc_html__('Add widgets for footer columns:', '_ac' ),
                        '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', '_ac_register_sidebars' );

From wp-admin, I can see my sidebar, and I dragged 3 copies of the “Custom HTML” widgets into it.

enter image description here

From this point, my mind has gone blank in what to do next.

I tried adding the following to my footer.php file (within my child theme)….

    <aside id="custom-footer-area" class="widget-area" role="complementary">
        <?php dynamic_sidebar( 'footer-columns' ); ?> 
    </aside>

…but it displays nothing on the front-end. No elements in that area.

Do I need to also write a PHP class that extends WP_Widget, in order to publically show the OOTB “Custom HTML” widget?

Perhaps I’m overlooking something small…?

Thanks for saving this sinking ship!

0
klewis 3 months 2021-05-16T20:43:27-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse