WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP if statement sucking footer into wrapper (2 posts)

  1. mackost
    Member
    Posted 7 years ago #

    Hi,

    This isn't causing a problem at the moment (not unless it's causing IE to screw up my sidebar which I'm still researching/investigating) but I noticed my footer was getting attached to my content wrapper whenever I was calling a page with a php if statement that calls a specific category of posts that are constructed in a different way to rest of my posts. For example, some of my posts are full on article/blog posts while others are just snippets of text and links. Here is my blog for to be clear.

    I suspect it this snippet of code, so any help would be really appreciated.

    <!-- loop -->
    
    <?php if (have_posts()) :?>
    <?php $postCount=0; ?>
    <?php while (have_posts()) : the_post();?>
    <?php $postCount++;?>
    
    <?php if ( in_category('3') ) { ?>
    
    <div class="mpartgeneral">
    <?php the_content ('Read the rest of this entry &raquo;'); ?>
    
    <div class="date"><?php the_date('d-m-Y') ?> </div>
    </div>
     <?php } else { ?>
    
    <div class="mpart">
    
    <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
    <h2><?php the_author() ?> | Filed under <?php the_category(', ') ?></h2>
    
    <?php the_content ('Read the rest of this entry &raquo;'); ?>
    <? if (function_exists('social_bookmark')) { social_bookmark(); } ?> 
    
    <div class="date"><?php comments_popup_link('Comment now »', '1 Comment »', '% Comments »', 'commentslink'); ?> . <?php the_date('d-m-Y') ?></div>
    
    <br/>
    
    <div class="commentsblock">
    <?php comments_template(); ?>
    </div>
    
    <?php } ?>	
    
    <?php endwhile; ?>
    
    <?php else : ?>
    
    <h3>
    Not Found
    </h3>
    
    <strong>Sorry, but you are looking for something that isn't here.</strong>
    
    <?php endif; ?>
    
    <!-- end loop -->
  2. mackost
    Member
    Posted 7 years ago #

    Bump

Topic Closed

This topic has been closed to new replies.

About this Topic