How to add just one specific page to widget without plugin?

I added page to widget and my wordpress adds all my pages into widget.

I want add just contact page to widget and remove all other pages from the widget.

How to do that without plugin?

register_sidebar( array(
‘name’ => esc_html__( ‘Sidebar’, ‘onepress’ ),
‘id’ => ‘sidebar-1’,
‘description’ => ”,
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h2 class=”widget-title”>’,
‘after_title’ => ‘</h2>’,
) );

Read more here:: How to add just one specific page to widget without plugin?

Leave a Reply

Your email address will not be published. Required fields are marked *