WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Mr.NEM
    Member
    Posted 1 year ago #

    Hi,

    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>
    
    		</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>
    
    		</div><!-- #secondary -->
    
    	<?php endif; ?>
    
    <?php get_footer(); ?>

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

  2. alchymyth
    Forum Moderator
    Posted 1 year 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
    Member
    Posted 1 year ago #

    Thanks a lot man, it worked !

  4. alchymyth
    Forum Moderator
    Posted 1 year 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
    Member
    Posted 1 year 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>
    	</div>
    	<?php endif; ?>
    		<header class="entry-header">
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    		</header>
    
    		<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
    Forum Moderator
    Posted 1 year ago #

    the code looks ok;

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic