2010 category.php Screws Layout after specifying Category
-
The site is pictopoetry.co.uk.
I have used the category.php template page to make my own category pages in a child theme of notesblog core. One to display blog posts and one to display poems i.e.
category-blog.php
category-poem.phpWhen I edit this part of the code (the default 2010 page is based on category three):
<?php $c = 0; if (have_posts()) : while (have_posts()) : the_post() ;$c++; if( $c == 1 ) $my_id = ' id="first"'; else $my_id = ''; ?> <!-- The following tests if the current post is in category 15. --> <!-- If it is, the div box is given the CSS class "post-cat-fifteen". --> <!-- Otherwise, the div box will be given the CSS class "post". --> <?php if ( in_category('15') ) { ?> <div class="post-cat-fifteen"<?php echo $my_id;?> > <?php } else { ?> <div class="post" <?php echo $my_id;?>> <?php } ?>
My layout gets mucked up and I can’t work it out. It’s the cake poem half way down that suffers.
Here are two pages one with the original code and one with the ammendment.
Many thanks
Martin
PS – the code differs a little from the 2010 page because of giving the first post its own id (thanks esmi)
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘2010 category.php Screws Layout after specifying Category’ is closed to new replies.