html - Similarly structured WordPress template files producing different CSS styling -
i have 2 identical wordpress category template files being displayed differently in browser.
the black-colored band @ bottom of this page should extend across entire width of page, on this page, reason not.
both category template files structured same (as far can tell) , use same style sheet, @ loss why being displayed differently browser. adding closing incorrectly styled page seems solve problem, can't figure out why closing necessary in 1 template file, not in other.
the code correctly-styled template file follows:
<?php get_header(); ?> <body class="projects"> <div id="page-container"> <?php get_sidebar(); ?> <div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div <?php post_class(); ?>> <div class="post-container"> <div class="post-title"> <span class="date"><?php the_time('f j, y'); ?></span><h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><h3> </div> <div class="post-content"> <?php the_content(''); ?> </div> <div class="post-footer"> <p>by:</p><div class="post-footer-item"><?php the_author_posts_link(); ?></div><p>category:</p><div class="post-footer-item"><?php the_category(', '); ?></div><div class="post-footer-action"><a href="<?php the_permalink(); ?>"><p><?php comments_number('0','1','%'); ?></p><img id="comments" src="<?php bloginfo('template_directory'); ?>/images/comments.png" height=20px></a></div><div class="post-footer-action"><a href="#"><p>44</p><img id="likes" src="<?php bloginfo('template_directory'); ?>/images/likes.png" height=20px></a></div> </div> </div> <?php endwhile; ?> <div id="more-posts"> <a href="<?php next_posts_link(''); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/more.png" width=200></a> </div> </div> <?php endif; ?> </div> </div>
the code incorrectly-styled template follows:
<?php get_header(); ?> <body class="adventures"> <div id="page-container"> <?php get_sidebar(); ?> <div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div <?php post_class(); ?>> <div class="post-container"> <div class="post-title"> <span class="date"><?php the_time('f j, y'); ?></span><h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> </div> <div class="post-content"> <?php the_content(''); ?> </div> <div class="post-footer"> <p>by:</p><div class="post-footer-item"><?php the_author_posts_link(); ?></div><p>category:</p><div class="post-footer-item"><?php the_category(', '); ?></div><div class="post-footer-action"><a href="<?php the_permalink(); ?>"><p><?php comments_number('0','1','%'); ?></p><img id="comments" src="<?php bloginfo('template_directory'); ?>/images/comments.png" height=20px></a></div><div class="post-footer-action"><a href="#"><p>44</p><img id="likes" src="<?php bloginfo('template_directory'); ?>/images/likes.png" height=20px></a></div> </div> </div> <?php endwhile; ?> <div id="more-posts"> <a href="<?php next_posts_link(''); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/more.png" width=200></a> </div> </div> <?php endif; ?> </div> </div>
thanks in advance help.
i first notice have opening tag inside while(have_posts())
(<div <?php post_class(); ?>>
), closing tag included regardless of whether there post or not.
also, have @ source (or better yet, firebug). in example incorrect, <footer>
element inside <div id="page-container">
, in other 1 below it. there more source section posted, cannot see call get_footer();
on either example?
Comments
Post a Comment