Here’s the way i would code it. Tested
Add to functions file
add_action( 'widgets_init', 'wpsites_add_widget' );
function wpsites_add_widget() {
register_sidebar(array(
'name'=>'Sidebar-Aries',
'id' => 'sidebar-aries',
'description' =>'Display all the contents of sidebar at Aries page.',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
Or you could use this code in your template and change the classes to match your existing widget
Option 1 – Add to template
<?php if ( is_active_sidebar( 'sidebar-aries' ) ) : ?>
<ul id="sidebar">
<?php dynamic_sidebar( 'sidebar-aries' ); ?>
</ul>
<?php endif; ?>
Option 2 – Add to template
You could also add a conditional tag to control which pages your widget outputs
<?php if ( is_active_sidebar( 'sidebar-aries' ) && is_conditional() ) : ?>
<ul id="sidebar">
<?php dynamic_sidebar( 'sidebar-aries' ); ?>
</ul>
<?php endif; ?>
Replace is_conditional()
with your conditional tag