• I have a website, thethoughtbubble.me
    It’s currently under construction, but close to done.

    I’m having issues with my categories links.

    If I used the following HTML and PHP, my site breaks. The stick-it notes get all screwed up.

    <?php get_header(); ?>
    <?php include('nav.php'); ?>
    
    <div id="mainContainer">
        	<div id="mainContentContainer" class="borderDefault">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                <div id="contentDate">
                Posted on <?php the_time('F jS, Y') ?>
            	</div>
                <div id="contentNavContainer">
    	    	</div>
                <div id="contentTitle">
                <h1><?php the_title(); ?></h1>
                </div>
                <div id="content">
              	<p><?php the_content(__('(more...)')); ?></p>
    		<?php endwhile; else: ?>
    		<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
                </div>
            </div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    However, as soon as I remove any information pertaining to the loop and am left with:

    <?php get_header(); ?>
    <?php include('nav.php'); ?>
    
    <div id="mainContainer">
        	<div id="mainContentContainer" class="borderDefault">
                <div id="contentDate">
                </div>
                <div id="contentNavContainer">
    	    </div>
                <div id="contentTitle">
                <h1></h1>
                </div>
                <div id="content">
                </div>
            </div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    My site works fine.
    Any thoughts? I don’t think it’s my HTML, as the other parts of the site are working. It’s only on when you click on a category.

Viewing 1 replies (of 1 total)
  • I think your WHILE is including a surplus <DIV id="content"> which is not closed within the loop. You need to emit </div> before the ELSE and before the ENDIF, and remove the </div> that is after the endif.

    Also as presented your <div id="mainContainer"> is not closed, but this is likely because you have only given part of the code.

Viewing 1 replies (of 1 total)
  • The topic ‘Loop Help’ is closed to new replies.