WordPress.org

Ready to get started?Download WordPress

Forums

Where to find 'reply' on threaded comments? (15 posts)

  1. ronaldb73
    Member
    Posted 5 years ago #

    The new threaded comments system is very nice, but I'd like to be able to change the text Reply. Where can I do this, I can't find it in the code of the comments.php.

  2. Doodlebee
    Member
    Posted 5 years ago #

    It's not in comments.php, it's in "single.php" - where the comments template is called in. I don't know what theme you're using, but look at that file - you'll probably see it.

  3. ronaldb73
    Member
    Posted 5 years ago #

    Not to find there, this is the entire code in single.php (theme Magazine Basic).

    <?php get_header(); ?>

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

    <div class="post" id="post-<?php the_ID(); ?>">
    <h1><?php the_title(); ?></h1>
    <div class="entry">
    <?php the_content(); ?>

    <?php the_tags( '<p class="tags">Tags: ', ', ', '</p>'); ?>

    <p class="postmetadata alt">
    <small>
    Dit bericht is toegevoegd
    op <?php the_time('l j F Y') ?> om <?php the_time() ?> uur. | <?php if(function_exists('wp_email')) { email_link(); } ?>

    </small>
    </p>

    </div>
    </div>

    <?php comments_template(); ?>

    <?php endwhile; else: ?>

    <p>Sorry, no posts matched your criteria.</p>

    <?php endif; ?>

    <?php get_footer(); ?>

  4. Doodlebee
    Member
    Posted 5 years ago #

    Oh wait - sorry - you're right. At least, assuming you mean "Leave a Reply" - which is what the default says. I have no idea what theme you're using (nor where your site is, so I'm guessing things here) so in the default theme, the message is a link that says "Leave a Reply" and when clicked, it takes you to the comment form. If so, then in the comments.php file, you're looking for this:

    <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>

    At least, that's what it is in the default theme. You might look at the files in the default theme and compare them to your files - you'll probably find the answer better that way than having me (or someone else) guess at how your is set up. but the Default theme pretty much has all the code you need - you can probably pick it apart and find it in there - whatever yours is missing, the default most likely has.

  5. ronaldb73
    Member
    Posted 5 years ago #

    It's not the leave a reply message, thats part of the comment-form. It's, in 2.7 with threaded comments, just the word 'reply' (looks like a little button) to let visitors reply to a comment of someone else. I've checked almost all php-files and can't find it.

    My theme is Magazine Basic
    WP 2.7
    http://www.uitgaandenhelder.nl (still in progress).

  6. Jeremy Clark
    Moderator
    Posted 5 years ago #

    Okay the text is generated by wordpress itself. The code that generates the text is in the functions.php file of you theme. Look for this code.

    <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    You'll need to change the code to this.

    <?php comment_reply_link(array_merge($args, 'reply_text' => 'EDIT THIS TEXT', array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    Where you change EDIT THIS TEXT to what you want to show up.

  7. ronaldb73
    Member
    Posted 5 years ago #

    almost there :-)
    When I copy and paste your suggested line, the blog stops working and the visitor sees a fatal error message.
    When I trim the line to the following:
    <?php comment_reply_link(array_merge($args, 'Reageren', array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    the site works fine, but I get the following error messaging on a post where someone has entered a comment:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/uitgaan/domains/uitgaandenhelder.nl/public_html/wp-content/themes/magazine-basic/functions.php on line 676

    Help!

  8. Doodlebee
    Member
    Posted 5 years ago #

    Oooohh... I see. Sorry - I really shouldn't answer on the forums in the morning before I've had my 2 cups of coffee :)

    You've misinterpreted his section: you've got

    <?php comment_reply_link(array_merge($args, 'Reageren', array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    your 'Reageren' is actually an array - but since you've renamed it, it can't find what it needs. You need to do this:

    <?php comment_reply_link(array_merge($args, 'reply_text' => 'Reageren', array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

  9. ronaldb73
    Member
    Posted 5 years ago #

    Done it, doesnt work. See the errormessage on the site:
    http://www.uitgaandenhelder.nl

  10. ronaldb73
    Member
    Posted 5 years ago #

    the error message that shows after applying the above, is:

    Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/uitgaan/domains/uitgaandenhelder.nl/public_html/wp-content/themes/magazine-basic/functions.php on line 676

  11. Jeremy Clark
    Moderator
    Posted 5 years ago #

    Try it this way.

    <?php comment_reply_link(array ('reply_text' => 'Reageren', 'depth' => $depth, 'max_depth' => $args['max_depth'])) ?>

  12. ronaldb73
    Member
    Posted 5 years ago #

    Great, this works. Just one small issue: the button is too small, so the word 'reageren' doesn't fit.
    see this page to see what I mean.

    Can't find it in the style.css where to edit this (not in the style.css of my theme (Magazine Basic) and not in the default style.css that comes with WordPress.

  13. Jeremy Clark
    Moderator
    Posted 5 years ago #

    It's in the style.css file under
    ol.commentlist li div.reply you need to change the width to around 60px

  14. ronaldb73
    Member
    Posted 5 years ago #

    Thanks!
    Seems to be all working nicely now.

  15. belin
    Member
    Posted 5 years ago #

    I try your code and it worked really good for me. Thanks.


    Webdesign Stuttgart

Topic Closed

This topic has been closed to new replies.

About this Topic