First, register a widget sidebar in function.php with the following code.
register_sidebar( array(
‘name’ => ‘Custom Widget’,
‘id’ => ‘custom-widget’,
‘before_widget’ => ‘<div>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h2 class=”rounded”>’,
‘after_title’ => ‘</h2>’,
) );
You will see this widget in WordPress back end >> Appearance >> Widget >> Custom Widget and copy/paste your content in this widget. Once done,
Copy the following code in any PHP file where you want to show up the widget/content.
<?php dynamic_sidebar(‘Custom Widget’); ?>