• Hi,

    this is sidebar.php

    <?php query_posts(‘category_name=News&showposts=5’); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class=”sidebar_news”>

    <p class=”date”><?php the_date(); ?></p>

    <h2>“><?php the_title(); ?></h2>

    </div> <!– SIDEBAR NEWS–>

    <?php endwhile; ?>
    <?php endif; ?>

    <?php if (function_exists(‘dynamic_sidebar’) && dynamic_sidebar(‘Sidebar Widgets’)) : else : ?>

    <!– All this stuff in here only shows up if you DON’T have any widgets active in this zone –>

    <?php endif; ?>

    and this is single.php

    <?php get_header(); ?>

    <?php /*?>
    // disable the sidebar and it works
    <?php get_sidebar(); ?>
    <?php */?>

    <div id=”content”>

    <?php /*?>
    <?php reset_query(); ?>
    <?php */?>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, get_post_format() ); ?>

    <h2 id=”post-title”><?php the_title(); ?></h2>

    <?php the_content(); ?>

    </div>

    <?php endwhile; // end of the loop. ?>

    <?php get_footer(); ?>

    If i enable the sidebar the post is always the newest, not the correct id.
    Any idea how to solve this??

    thank you!

  • The topic ‘sidebar conflicting with single.php’ is closed to new replies.