Post-specific widgets in WordPress ‘Twenty Fourteen’ theme

You can install a plugin like widget visibility or Widget Logic which enables you to add conditional tags to specify which posts, pages etc your widgets display.

Otherwise, you would need to add the conditional tags to your themes native sidebar widget area’s to control which posts, pages etc they display.

Example:

If you only wanted your widget to display on single posts, you would add the conditional tag:

is_single()

or

is_singular('post')

To exclude widgets from displaying on single posts, you would use the same conditional tag like this:

!is_single()

See this code example if you want to code your own custom sidebar widgets.

You can register the widget in your child themes functions file then hook it in directly in any template file or by using a custom functions in your child themes functions file.

Registers a new widget

add_action( 'widgets_init', 'wpsites_add_widget' );

function wpsites_add_widget() {

register_sidebar(array(
'name'=>'Custom Widget',
'id' => 'custom-widget',
));
}

Add to template file like single.php

<?php if ( is_active_sidebar( 'custom-widget' ) ) : ?>
<ul id="sidebar">
<?php dynamic_sidebar( 'custom-widget' ); ?>
</ul>
<?php endif; ?>

Source http://codex.wordpress.org/Function_Reference/dynamic_sidebar