Hello all, First of all, I apologize for having to paste the whole code in here. Unfortunately, even though I know which part of the code makes the problem occur, I don't know what I need to show you in order for you to help me fix it. So, having said that, here is the problem: This is for wordpress. I am trying to add a box below my post (in the single post page) that includes a dropdown menu showing the other posts in that same category. To do this, I am adding this part: <div class="post-footer clearfix"> <div class="category-menu"> <div class="category clearfix"> <div><a href="#"><span class="indicator"></span> <?php echo $category[0]->cat_name; ?></a></div> </div> <div class="dropdown"> <ul class="cat-posts"> <?php $posted = get_posts( "category=" . $category[0]->cat_ID ); if( $posted ) : foreach( $posted as $post ) : setup_postdata( $posted ); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><span><?php the_time( ' F j, Y' ) ?></span></li> <?php endforeach; endif; ?> <li class="view-more"><a href="<?php echo get_category_link( $category[0]->cat_ID ); ?>" class="view-more">View More »</a></li> </ul> </div><!-- End dropdown --> </div><!-- End category --> </div><!-- End post-footer --> Code (markup): Adding that part to the singlepage.php as you can see below, makes the box appear and operate properly, however, for some very strange reason, the comments no longer work. Comments are not displayed and when someone tries to make a comment they are forwarded to a blank page (wp-comments-post.php). If I edit out the above code, the comments start to work again. So, somehow, that code interferes with the comments. Please, find below the whole code of the page with the code that I am adding in bold. <?php get_header(); ?> <div id="main-content" class="clearfix"> <div class="container"> <div class="col-580 left"> <?php if (have_posts()) : while (have_posts()) : the_post(); $category = get_the_category(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="post-meta clearfix"> <h3 class="post-title left"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <p class="post-info right"> <span>By <?php the_author_posts_link(); ?></span> <?php the_time( 'l F j, Y' ) ?> </p> </div><!-- End post-meta --> <?php if(function_exists('the_ratings')) { the_ratings(); } ?> <div class="post-box"> <div class="page-content clearfix"> <div class="clearfix"> <?php if( get_post_meta( $post->ID, "image_value", true ) ) : ?> <div class="post-image-inner right"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php bloginfo( 'template_directory' ); ?>/timthumb.php?src=<?php echo get_post_meta( $post->ID, "image_value", true ); ?>&w=225&h=246&zc=1" alt="<?php the_title(); ?>" /></a> </div> <?php endif; ?> <?php the_content( '' ); ?> <?php wp_link_pages( array( 'before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number' ) ); ?> <br /> </div> </div><!-- End post-content --> </div><!-- End post-box --> [B] <div class="post-footer clearfix"> <div class="category-menu"> <div class="category clearfix"> <div><a href="#"><span class="indicator"></span> <?php echo $category[0]->cat_name; ?></a></div> </div> <div class="dropdown"> <ul class="cat-posts"> <?php $posted = get_posts( "category=" . $category[0]->cat_ID ); if( $posted ) : foreach( $posted as $post ) : setup_postdata( $posted ); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><span><?php the_time( ' F j, Y' ) ?></span></li> <?php endforeach; endif; ?> <li class="view-more"><a href="<?php echo get_category_link( $category[0]->cat_ID ); ?>" class="view-more">View More »</a></li> </ul> </div><!-- End dropdown --> </div><!-- End category --> </div><!-- End post-footer --> [/B] </div><!-- End post --> <?php comments_template(); ?> <?php endwhile; endif; ?> </div><!-- End col-580 (Left Column) --> <div class="col-340 right"> <ul id="sidebar"> <?php get_sidebar(); ?> </ul><!-- End sidebar --> </div><!-- End col-340 (Right Column) --> </div><!-- End container --> </div><!-- End main-content --> <?php get_footer(); ?> Code (markup): I am guessing that it could be as simple as a <div> that was left open or something like that, but I tried some stuff and nothing seemed to work. Then again, I am no expert. PLEASE help Thanks in advance!
I see that noone has replied to this thread yet. If there is ANYTHING else that I can give you to help me solve this issue, please let me know. I didn't know what I was supposed to post so I posted the whole code from the page that had the problem. Maybe I should have posted the wp-comments-post.php code instead - Should I? I really don't know. Thanks again.
Paste your code again, but replace all the tabs with like four spaces and remove blank lines so that it all fits on the screen and is readable... That might help convince people to reply! (its a pain for me to look through that code). Also, does the PHP option in the toolbar allow for syntax highlighting?
Thanks for the suggestion! Here is the code without the tabs and with the PHP option that highlights syntax - The part that I adding and messes up the comments starts from <div class="post-footer clearfix"> and ends at </div><!-- End post-footer -->. <?php get_header(); ?> <div id="main-content" class="clearfix"> <div class="container"> <div class="col-580 left"> <?php if (have_posts()) : while (have_posts()) : the_post(); $category = get_the_category(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="post-meta clearfix"> <h3 class="post-title left"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <p class="post-info right"> <span>By <?php the_author_posts_link(); ?></span> <?php the_time( 'l F j, Y' ) ?> </p> </div><!-- End post-meta --> <?php if(function_exists('the_ratings')) { the_ratings(); } ?> <div class="post-box"> <div class="page-content clearfix"> <div class="clearfix"> <?php if( get_post_meta( $post->ID, "image_value", true ) ) : ?> <div class="post-image-inner right"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php bloginfo( 'template_directory' ); ?>/timthumb.php?src=<?php echo get_post_meta( $post->ID, "image_value", true ); ?>&w=225&h=246&zc=1" alt="<?php the_title(); ?>" /></a> </div> <?php endif; ?> <?php the_content( '' ); ?> <?php wp_link_pages( array( 'before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number' ) ); ?> <br /> </div> </div><!-- End post-content --> </div><!-- End post-box --> <div class="post-footer clearfix"> <div class="category-menu"> <div class="category clearfix"> <div><a href="#"><span class="indicator"></span> <?php echo $category[0]->cat_name; ?></a></div> </div> <div class="dropdown"> <ul class="cat-posts"> <?php $posted = get_posts( "category=" . $category[0]->cat_ID ); if( $posted ) : foreach( $posted as $post ) : setup_postdata( $posted ); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><span><?php the_time( ' F j, Y' ) ?></span></li> <?php endforeach; endif; ?> <li class="view-more"><a href="<?php echo get_category_link( $category[0]->cat_ID ); ?>" class="view-more">View More »</a></li> </ul> </div><!-- End dropdown --> </div><!-- End category --> </div><!-- End post-footer --> </div><!-- End post --> <?php comments_template(); ?> <?php endwhile; endif; ?> </div><!-- End col-580 (Left Column) --> <div class="col-340 right"> <ul id="sidebar"> <?php get_sidebar(); ?> </ul><!-- End sidebar --> </div><!-- End col-340 (Right Column) --> </div><!-- End container --> </div><!-- End main-content --> <?php get_footer(); ?> PHP: When I remove that part, the visitor can leave comments and everything is displayed properly. I just love that the category posts dropdown menu! PLEASE help?