Support » Plugin: Dynamic Widgets » Set dynamic widget to display widget area only on active pages/posts

  • Resolved ResaMichelle

    (@resamichelle)


    I’d like to make a widget area display only on the pages/posts/category archives on which a widget is active. How can I accomplish this? Thus far, I have this in my functions.php but it’s not sufficient.

    function child_before_posts_sidebar() {
    
    	if (is_active_sidebar() ) {
        echo '<div class="before-posts-sidebar">';
            dynamic_sidebar( 'before-posts-sidebar' );
        echo '</div>';
    	}
    	else {
    	echo '';
    	}
    
    }

    Thanks!

    http://wordpress.org/extend/plugins/dynamic-widgets/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Qurl

    (@qurl)

    Dynamic Widgets shows or hides widgets based on the rules you’ve set in the DW options. This question goes way beyond that and is in my opinion not a support question about DW.

    But you see, it is a dynamic widget issue because that particular sidebar IS active, yet it still does not display the widget where it should display. I was able to resolve this by other means, but to be clear, when dynamic widgets is active, or a widget is dynamic, the widget area does not register as active. Just a heads up.

    Plugin Author Qurl

    (@qurl)

    When a sidebar becomes empty due to rules you’ve set in DW, the sidebar becomes inactive. Also, as far as I know is_active_sidebar() needs an index parameter.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set dynamic widget to display widget area only on active pages/posts’ is closed to new replies.