Ready to get started?Download WordPress


Display Widgets
Widget not working properly if there's two sidebars (6 posts)

  1. Mr.NEM
    Posted 10 months ago #


    All the pages on my website are using two different sidebars, one on the left and one the right. So, the plugin works properly with the left sidebar but isn't working with the right sidebar.

    If I select 'Show on checked', nothing is showing and if I select 'Hide on checked', it shows on every page.

    Here's the code of my template :

    <?php get_header(); ?>	
    	<?php if ( is_active_sidebar( 'sidebar-8' ) ) : ?>
    		<div id="secondary" class="widget-area span3 " role="complementary">
    			<div id="st-left" class="st-sidebar-list">
    			<?php dynamic_sidebar( 'sidebar-8' ); ?>
    		</div><!-- #secondary -->
    	<?php endif; ?>
    	<div id="primary" class="site-content span9">
    		<div id="content" role="main" >
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( '/partials/content', 'page' ); ?>
    			<?php endwhile; // end of the loop. ?>
    		</div><!-- #content -->
    	</div><!-- #primary -->	
    	<?php if ( is_active_sidebar( 'sidebar-9' ) ) : ?>
    		<div id="secondary" class="widget-area span3" role="complementary">
    			<div id="st-right" class="st-sidebar-list">
    			<?php dynamic_sidebar( 'sidebar-9' ); ?>
    		</div><!-- #secondary -->
    	<?php endif; ?>
    <?php get_footer(); ?>


  2. alchymyth
    The Sweeper & Moderator
    Posted 10 months ago #

    what theme are you usig?

    is there possibly any coding in the content section whihc might change the original querystring?

    try to add <?php wp_reset_query(); ?> before this line: <?php dynamic_sidebar( 'sidebar-9' ); ?>

  3. Mr.NEM
    Posted 10 months ago #

    Thanks a lot man, it worked !

  4. alchymyth
    The Sweeper & Moderator
    Posted 10 months ago #

    this is just a 'patch' like covering the symptoms - it would be great if you could find the cause and fix that.

  5. Mr.NEM
    Posted 10 months ago #

    Sure thing, but i'm still a newbie in term of wordpress functions, so i don't know what could cause the query string to be modified within that code :

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<?php if ( has_post_thumbnail() ) : // check to see if our post has a thumbnail	?>
    	<div class="row-fluid">
    		<div class="post-thumbnail span12" style="margin-bottom:40px;"><?php the_post_thumbnail( ); ?></div>
    	<?php endif; ?>
    		<header class="entry-header">
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    		<div class="entry-content">
    			<?php the_content(); ?>
    		</div><!-- .entry-content -->
    		<footer class="entry-meta">
    			<?php wp_link_pages( array( 'before' => '<span><span class="page-links">' . __( 'Pages: </span>', 'mytheme' ), 'after' => '</span><br />' ) ); ?>
    		</footer><!-- .entry-meta -->
    	</article><!-- #post -->
  6. alchymyth
    The Sweeper & Moderator
    Posted 10 months ago #

    the code looks ok;

    the change of the querystring could be caused by a plugin (?)


You must log in to post.

About this Plugin

About this Topic