Jump to content
Sign in to follow this  
hugobs

cannot hide leave a reply on posts

Recommended Posts

hugobs

hello there, i have a problem with my Whitehouse theme: although most of my posts do not allow comments and trackbacks, the 'LEAVE A REPLY" link still appears at the bottom. any idea on how to remove that link on posts which do not allow comments? thanks, hugo.

Share this post


Link to post
Share on other sites
cmunns

Sure can you tell me what version of the theme you are using? Maybe provide a live link if possible?

Share this post


Link to post
Share on other sites
hugobs

i'm using whitehouse 1.4.3. here's a link: ww.humanrights-defenders.org/mechanisms/un/. comments/trackbacks are disabled for these posts, but "comment" and "leave a reply" still appear on the post footer. many thanks in advance!

Share this post


Link to post
Share on other sites
Andrew

seems like there is a bunch of customization going on... did you change the _posts.php file?

Share this post


Link to post
Share on other sites
hugobs

i changed the _posts.php to have the category description displayed at the top of the first post when clicking on a category. no other changes. the _posts.php looks like this: <?php if (is_category()) { ?> <?php $category = get_the_category(); echo $category[0]->category_description; ?> <?php } ?> <?php if(is_search()):?><div class="copy"><h3 class="pagetitle"><?php _e('Search Results', TDOMAIN);?></h3></div><?php endif;?> <?php if(is_single()){include(TEMPLATEPATH.'/_postnav.php');}?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="postwrap"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <div class="copy fix"> <div class="post-title"> <h3>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h3> </div> <!--/post-title --> <div class="post-date"><?php _e('On', TDOMAIN);?> <?php the_time(get_option('date_format')); ?></div><?php _e('In',TDOMAIN);?> <?php the_category(', ', TDOMAIN) ?> <?php _e('By', TDOMAIN);?> <?php the_author(); ?> <?php if(is_single() && pagelines('excerptshidesingle')):?> <?php else: ?> <?php if(!pagelines('excerptshide') && VPRO):?><div class="post-excerpt"><?php the_excerpt(); ?></div><?php endif;?> <?php endif; ?> </div> <?php if(is_single() || !pagelines('excerpts') || !VPRO):?> <div class="copy"> <div class="post-content"> <?php if(function_exists('the_post_thumbnail') && has_post_thumbnail()): ?> <div class="postthumb"> " rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>"> <?php the_post_thumbnail('thumbnail');?> </div> <?php endif; ?> <?php the_content(); ?> <?php if(is_single()) link_pages('<p>Pages: ', '</p>', 'number'); ?> <?php edit_post_link('Edit Post', '', '');?> </div> <div class="tags"> <?php the_tags('Tagged with: ',' • ',''); ?> </div> </div> <?php if(pagelines('authorinfo') && VPRO):?> <?php include(TEMPLATEPATH.'/_authorinfo.php');?> <?php endif;?> <?php endif;?> <div class="post-footer pfooterlight"> <?php if(is_single() && VPRO):?> <div class="left"> <?php _e('If you enjoyed this article, please consider sharing it!', TDOMAIN);?></div> <div class="right"> &title=<?php the_title(); ?>" title="Bookmark at Delicious" rel="nofollow" target="_blank">/ico-soc1.gif" alt="Delicious" /> " title="Bookmark at Mixx" rel="nofollow" target="_blank">/ico-soc2.gif" alt="Mixx" /> &title=<?php the_title(); ?>" title="Bookmark at StumbleUpon" rel="nofollow" target="_blank">/ico-soc3.gif" alt="StumbleUpon" /> &title=<?php the_title(); ?>" title="Bookmark at Digg" rel="nofollow" target="_blank">/ico-soc4.gif" alt="Digg" /> </div> <?php else:?> <div class="left"> <span><?php comments_number(0, 1, '%'); ?></span> #comments" title="<?php _e('View Comments');?>"><?php _e('Comments');?> </div> <div class="right"> <?php edit_post_link('Edit Post', '', ' | ');?><span>#respond" title="<?php _e('Leave A Response');?>"><?php _e('Leave A Response');?></span></div> <?php endif; ?> <div class="clear"></div> </div> <div class="hl"></div> </div><!--post --> </div> <?php if(is_single()):?> <?php include(TEMPLATEPATH.'/_commentsform.php');?> <?php endif; endwhile; ?> <?php include(TEMPLATEPATH.'/_pagination.php');?> <?php else : ?> <h2 class="center"><?php _e('Nothing Found');?></h2> <p class="center"><?php _e('Sorry, what you are looking for isn't here.');?></p> <div class="center fix"><?php get_search_form(); ?></div> <?php endif; ?> thanks in advance! hugo.

Share this post


Link to post
Share on other sites
cmunns

You can wrap that section of code controlling the leave a reply section with a conditional like the one below <?php if (comments_open()):?> . . . <?php endif;?>

Share this post


Link to post
Share on other sites
katy

Greetings, Thank you for your work on this informative forum. Recently cmunns gave hugobs advice above (cannot hide "leave a reply" on posts). It was the exact advice I needed but the description of what to do with the php was not specific enough for me. I am not a coder, but I could do this easily if you could tell me exactly where to place the conditional. cmunns, you said ???You can wrap that section of code controlling the leave a reply section with a conditional like the one below: ??? <?php if (comments_open()):?> . . . <?php endif;?> I have the same version of Whitehouse that hugobs has, 1.4.3. Except for the customization he made which he mentioned above, this code shown here is identical to mine. (The comments sections are identical). There are already several similar php conditionals already in the present code, and I don??™t know whether to erase them or which ones to replace and where. There appear to be at least two sections of code regarding comments. Since there are two sections about comments, both already wrapped in php conditionals, I don??™t know what to do. I didn??™t think you were saying to wrap the two different sections. Exact start and endpoints and what to delete or replace, etc. would be invaluable. Thank you in advance for your help. Katy

Share this post


Link to post
Share on other sites
hugobs

hu Katy, just place it here: <?php if (comments_open()):?> <div class="left"> <span><?php comments_number(0, 1, '%'); ?></span> #comments" title="<?php _e('View Comments');?>"><?php _e('Comments');?> </div> <div class="right"> <?php edit_post_link('Edit Post', '', ' | ');?><span>#respond" title="<?php _e('Leave A Response');?>"><?php _e('Leave A Response');?></span></div> <?php endif;?> <?php endif; ?>

Share this post


Link to post
Share on other sites
katy

Greetings, This solution worked perfectly. Apparently you gave me my first lesson in nested conditional statements. Thank you, Hugo. Katy

Share this post


Link to post
Share on other sites
cmunns

You'll be there before you know it :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×