i am trying to build up a single.php page. this page is used to show a full single post.
i have 3 loops on it. first two are used (each) for geting a random post from a specific category.
1
<?php query_posts(array('orderby' => 'rand', 'category_name' => announcement, 'showposts' => 1)); if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
2
<?php query_posts(array('orderby' => 'rand', 'category_name' => quote, 'showposts' => 1)); if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
the problem is with the third loop that should display the REAL post itself.
3
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; else: ?>
<?php endif; ?>
^^ this displays the same post as #2.
so, #1 and #2 work great, but how to get the #3 to display the single post that it is supposed to - for example from link http://example.com/one-post/ the post titled one-post should be displayed.
#1 and #2 are in the 'top' area of the page and #3 should be in the middle of the page.