• Resolved robsbots

    (@robsbots)


    Hi all. This may have been covered before but I can’t seem to find it.
    I’m running WP 3.1.4 with the 2011 Theme.

    I have added
    <?php $withcomments = "1"; comments_template(); /* Get wp-comments.php template */ ?>
    to the loop to display comments on the index page.

    What I would like to do is hide the reply box. I would like comments to be available via the reply link, just to get rid of the reply box on that page and still show comments, and allow them to be added via the link.

    Thanks for any help you can offer.

    Rob

Viewing 9 replies - 1 through 9 (of 9 total)
  • Do not edit the Twenty Eleven theme. It is the default WordPress theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. First create a child theme for your changes.

    Thread Starter robsbots

    (@robsbots)

    Wow. That was quick. Would I just copy it to a new dir to create a child theme ?

    No. Please see the link I posted above.

    Thread Starter robsbots

    (@robsbots)

    Thanks. I’m on it.

    Thread Starter robsbots

    (@robsbots)

    Cracked it. I have a child theme of 2011 up and running with the
    <?php $withcomments = "1"; comments_template(); ?>
    mod and a standard 2011 theme.

    Thread Starter robsbots

    (@robsbots)

    Where should I go from here. I can play with the child theme but have no idea how to remove the reply box.

    Thanks

    Rob

    try and use a custom comments template file;
    http://codex.wordpress.org/Function_Reference/comments_template

    i.e. change this:

    <?php $withcomments = "1"; comments_template(); ?>

    to:

    <?php $withcomments = "1"; comments_template('/frontpage-comments.php'); ?>

    then create a frontpage-comments.php froma copy of comments.php, and remove the call of the comment form;
    i.e. remove this line:

    <?php comment_form(); ?>

    Thread Starter robsbots

    (@robsbots)

    Hi Alchymyth.

    That was just what I was after.

    Perfect.

    Thanks very much for you help.

    A thank you to Esmi as well.

    I now have a custom version of the twenty-eleven theme that displays comments on the front page but the ‘reply box’ is not shown. To reply I just click the link and up it pops on the post page.

    Thanks both of you for your help.

    Rob.

    Thread Starter robsbots

    (@robsbots)

    Sorry.

    Forgot to mark as solved :$

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Hiding reply box in 2011’ is closed to new replies.