• Below is the code for my index page. What I am trying to do is have one loop that pulls from one cat and one that pulls from another. I have followed every tutorial i can find here and in the codex, but seem to be missing something really small. Help?

    <?php get_header(); ?>
            <div id="waxpaper">
    
    	<div id="content" class="narrowcolumn">
    
    	<?php query_posts('showposts=1&cat=1'); ?>
        <?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> by <?php the_author() ?></small>
    
    				<div class="entry">
    					<?php the_excerpt(); ?>
    				</div>
    
    				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    	  </div>
    
    		<?php endwhile; ?>
    <div>
    
    <?php query_posts('showposts=1&cat=2'); ?>
        <?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> by <?php the_author() ?></small>
    
    				<div class="entry">
    					<?php the_excerpt(); ?>
    				</div>
    
    				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    	<?php endif; ?>
    	</div>
    
    <?php get_sidebar(); ?>
    
           </div>
    
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter feefergross

    (@feefergross)

    The error I get is: Parse error: syntax error, unexpected T_ELSE in /home/rawfully/public_html/wp-content/themes/default/index.php on line 44

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    You have an else that is seemingly going unused.

    Get rid of this bit entirely:

    <?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    	<?php endif; ?>

    Thread Starter feefergross

    (@feefergross)

    Ok, that got the site working again, BUT, I am still only seeing one WordPress loop.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Loop Problems’ is closed to new replies.