WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using Wordpress 3.8.1 with 'Twenty Fourteen' theme I'd like to arrange my post in such a way that it's main contents go to main (center) column while galleries, attached files and links pertaining to this post go to content sidebar to the right. How can I do that? Do I need some specific plugins?

Right now I can place in the content sidebar only site-specific widgets. I think that sidebar named 'content' and visually placed and styled like post should display post-specific widgets but I'm unable to force it to that.

share|improve this question

migrated from webapps.stackexchange.com Feb 23 '14 at 11:21

This question came from our site for power users of web applications.

The content sidebar are just a normal sidebar like all the others. The creator of twenty fourteen just gave it that name. It behaves and works just like the footer sidebar and the main sidebar. To do what you want you will have to code a widget specifically for that. – Pieter Goosen Feb 23 '14 at 11:29

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.


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




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


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() {

'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' ); ?>
<?php endif; ?>

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

share|improve this answer

While the logic can get complicated, you can control the display of widgets to a significant degree using the widget_display_callback filter.

For example, this will allow only the Core Text widget to be displayed in the sidebar with ID "sidebar-1" :

  function ($instance, $widget, $sidebar){
    if (
      && 'sidebar-1' === $sidebar['id']
    ) {
      if ('WP_Widget_Text' !== get_class($widget)) {
        return false;
    return $instance;
share|improve this answer

If anyone is still looking for best solution, feel free to check https://wordpress.org/plugins/widget-options/ . It has a post category option to hide the widgets on associated post per category. But if you still want to do it manually; using widget_display_callback is the best one I can recommend to filter widgets.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.