• I am desperately needing some help Removing the Comments Closed Text Appearing on all the pages where comments not accepted. Can someone please help me to remove this text that shows up??

    Thnaks in advance…

Viewing 7 replies - 1 through 7 (of 7 total)
  • in page.php, and maybe you want to do it for single.php too, look for the comment’s template code:
    <?php comments_template(); ?>

    and add these lines before and after so it looks like:

    <?php if ( comments_open() ) : ?>
    	<?php comments_template(); ?>
    	<?php endif; ?>

    that will make it so that if comments are open, they are shown like normal. But if they are closed, nothing shows up, so it won’t say comments are closed.

    Thread Starter abel42

    (@abel42)

    Thnaks RVoodoo for the the help and quick response.
    Do I put this at the top of the page in a specific place in the code?

    Thanks again

    into the actual template in your theme, from within the theme editor. Usually the comment template code is towards the bottom of the file.

    you should already have the <?php comments_template(); ?> code in there. Just add the line of code above it and below like in my example.

    if your page.php and single.php templates don’t have the <?php comments_template(); ?> bit of code, I would need to see what code is used to display comments…..

    Thread Starter abel42

    (@abel42)

    RVoodoo,

    Here is what my page.php code looks like, where should the code be pasted?:

    <?php

    function render_content() {

    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); // the loop ?>

    <!–Post Wrapper Class–>
    <div class=”post”>

    <!–Title–>
    <div class=”title wrap”>
    <div class=”post-title”>
    <h1 id=”post-<?php the_ID(); ?>”><?php the_title(); ?></h1>
    </div>
    </div>

    <!–post text with the read more link–>
    <div class=”post-content”>
    <?php the_content(); ?>
    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>
    </div>
    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
    <!–post meta info–>
    <div class=”meta-bottom wrap”>
    </div>

    </div><!–end .post–>

    <?php comments_template(); // include comments template ?>

    <?php endwhile; // end of one post ?>
    <?php else : // do not delete ?>

    <div class=”post”>
    <h3><?php _e(“Page not Found”); ?></h3>
    <p><?php _e(“We’re sorry, but the page you’re looking for isn’t here.”); ?></p>
    <p><?php _e(“Try searching for the page you are looking for or using the navigation in the header or sidebar”); ?></p>
    </div>

    <?php endif; // do not delete ?>
    <?php

    }

    add_action( ‘builder_layout_engine_render_content’, ‘render_content’ );

    do_action( ‘builder_layout_engine_render’, basename( __FILE__ ) );

    ?>

    this line: <?php comments_template(); // include comments template ?>

    add the lines of code above and below…. so it looks like this:

    <?php if ( comments_open() ) : ?>
    <?php comments_template(); // include comments template ?>
    <?php endif; ?>

    Thread Starter abel42

    (@abel42)

    Thanks for your time and explanation, works perfect..

    sure thing, glad it works!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Removing the Comments Closed Text Appearing on the pages where comments not acce’ is closed to new replies.