Div with empy id like, id=" "
-
This page leaves me with an empty ID on the <div class=”entry”> that holds the post.
If it is wrong I would really appreciate knowing why?
Many thanks
Martin
get_header(); ?> <div id="container"> <div id="content" role="main"> <h1 class="page-title"><?php //printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?>The PictoPoetry!</h1> <!-- Start the Loop. --> <?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 } ?> <!-- <img src="<?php //echo get_post_meta($post->ID, "thumbnail", true);?>" style="float: left;"/> --> <!-- Display the Title as a link to the Post's permalink. --> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. --> <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small> <!-- Display the Post's Content in a div box. --> <div class="entry" id=" <?php get_post_meta($post_id, $key); ?>"> <?php the_content(); ?> </div> <!-- Display a comma separated list of the Post's Categories. --> <p class="postmetadata">Posted in <?php the_category(', '); ?></p> </div> <!-- closes the first div box --> <!-- Stop The Loop (but note the "else:" - see next line). --> <?php endwhile; else: ?> <!-- The very first "if" tested to see if there were any Posts to --> <!-- display. This "else" part tells what do if there weren't any. --> <p>Sorry, no posts matched your criteria.</p> <!-- REALLY stop The Loop. --> <?php endif; ?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Div with empy id like, id=" "’ is closed to new replies.