WordPress.org

Ready to get started?Download WordPress

Forums

WP 2.7 - Replying beyond the maximum threaded/nested level (8 posts)

  1. TalkingBaseball
    Member
    Posted 5 years ago #

    So here's my question: I've recently adopted 2.7 and a new theme for my site, and the coding is nearly complete except for one issue: When my threaded comments reach the maximum threading level, my reply link disappears, and I can't get anything to show up that would even just add another comment below the last one. I've seen some sites where the "comments won't nest below this level" text pops up with a "reply here" option, but that's not happening.

    Here's the example on my test site: http://test.secondavenuesagas.com/2007/11/15/new-aside-post-on-top/comment-page-1/#comment-30

    Anyone know how to override this problem?

  2. What's your wp_list_comments look like? Specifically the 'reply_text' portion?

    This line is what I'm looking for:

    <?php wp_list_comments(array('avatar_size'=>40,'reply_text'=>'Reply to this comment')); ?>

    If it's what I think it is, I ran into this and can show you a trick.

  3. TalkingBaseball
    Member
    Posted 5 years ago #

    It looks like this:

    <?php wp_list_comments('type=comment'); ?>

    It's type=comment to separate the trackbacks from the comments, and the reply_text isn't specified. The stylings of the comments are accomplished through the CSS rules, with the following delineating the "reply" text:

    ol.commentlist li div.reply { background:#999; border:1px solid #666; border-radius:2px; -moz-border-radius:2px; -webkit-border-radius:2px; color:#fff; font:bold 9px/1 helvetica,arial,sans-serif; padding:5px 10px;  text-align:center; width:36px; }
    	 ol.commentlist li div.reply:hover { background:#2E8FC6; border:1px solid #0F3461; }
    	 ol.commentlist li div.reply a { color:#fff; text-decoration:none; text-transform:uppercase; }

    Thanks for your help. It's much appreciated.

  4. What's happening is that the <div class="reply"> is getting bordered even though there is no text. That's normal since that's what's in the CSS. You can fix that with a span class in your reply_text.

    Backup your theme files and try this:

    In your comments.php file, make the wp_list_comments() like so:

    <?php wp_list_comments(array('type=comment','reply_text'=>'<span class="reply-box">Reply</span>')); ?>

    Now change your CSS to this to move that formatting within the span class reply-box:

    ol.commentlist li div.reply span.reply-box { background:#999; border:1px solid #666; border-radius:2px; -moz-border-radius:2px; -webkit-border-radius:2px; color:#fff; font:bold 9px/1 helvetica,arial,sans-serif; padding:5px 10px;  text-align:center; width:36px; }
    ol.commentlist li div.reply span.reply-box:hover { background:#2E8FC6; border:1px solid #0F3461; }
    ol.commentlist li div.reply span.reply-box a { color:#fff; text-decoration:none; text-transform:uppercase; }

    Double check my CSS, I'm shooting that part from the hip.

    Now when there is a reply button you'll get

    <div class="reply">
      <a href='/some/url/here/#respond'><span class="reply-box">Reply</span></a>
    </div>

    and that will be bordered as so.

    When there is no reply you'll just have

    <div class="reply">
    </div>

    which won't be styled, so no border will show up.

  5. EDIT: Wow! Double submission! That lack of patience of mine is really working today! Pick the answer that reads best :)

    NUTS. bbPress gobbled my reply.

    Here goes again:

    The <div class="reply"> is getting a border even when there is no text. That's normal since that's what the CSS says. To fix is, wrap the Reply text in a span and style that span.

    Backup your theme's files and change the comments.php wp_list_comments() like so:

    <?php wp_list_comments(array('type=comment','reply_text'=>'<span class="reply-box">Reply</span>')); ?>

    Now modify your CSS to put that styling in the span:

    ol.commentlist li div.reply span.reply-box { background:#999; border:1px solid #666; border-radius:2px; -moz-border-radius:2px; -webkit-border-radius:2px; color:#fff; font:bold 9px/1 helvetica,arial,sans-serif; padding:5px 10px;  text-align:center; width:36px; }
    ol.commentlist li div.reply span.reply-box:hover { background:#2E8FC6; border:1px solid #0F3461; }
    ol.commentlist li div.reply span.reply-box a { color:#fff; text-decoration:none; text-transform:uppercase; }

    Double check the CSS, I'm shooting from the hip there.

    Now when the Reply button is needed, it will wrap in in the span class "reply-box" and style it.

    When the button is not needed, you'll be left with an empty

    <div class="reply">
    </div>

    And that's fine. The border is around the span, not the reply class.

  6. TalkingBaseball
    Member
    Posted 5 years ago #

    But I want my users to be able to reply to a comment at that level so that it continues to nest at the same level.

    Basically, when a thread reaches its maximum nesting value, I want this type of action to happen with the link at the bottom that says "reply here" (underneath this comment). That way, commenters can continue to post in the same thread, but it shows up underneath the last comment in the same permissible nesting level. Does that make sense?

    I think I'm asking for more of a core WP 2.7 threaded comment function than anything else right now. Not sure if this is doable.

  7. *THUNK* and I typed the reply twice while misunderstanding...

    That site is using Brian's Threaded Comments and not the native 2.7 functionality. I've not used it so I can't say for sure if it works in 2.7 without any issues.

    Doing that in 2.7 with wp_list_comments()... huh, that's a good question. You'd probably have to create your own comment walker or just write a really comprehensive callback. I've no idea how to accomplish what you want myself.

    The wp_list_comments() is extremely customizable so I doubt you would need to hack the core files at all.

    Take a look at the Tarski theme, I think they achieve their comment threads not via a callback but by using a custom walker.

    If you can work out the logic, then you can do a callback which might be easier than the walker.

  8. TalkingBaseball
    Member
    Posted 5 years ago #

    BTC does indeed work in 2.7. The second one is my site as well! I'll poke around on the Tarski theme. Thanks for you help.

Topic Closed

This topic has been closed to new replies.

About this Topic