Jump to content

How To Move All Comment Replies Under The Ones Replied To?


Mr Shawn

Recommended Posts

Here is the location of the comments I need help with on my scrap Blogger/blogspot blog. I'm trying to move the replies under the ones they reply to. 1. I want to move the reply starting from the <li> node it is in, then 2. place it in a <ul> tag with the class "children" inside of the <li> node of which the comment replies to 3. I also want to remove the <a>reply</a> from the moved comment(s) Help me please :(

Link to comment
Share on other sites

Are you trying to do that with Javascript?
I got it done with jquery and javascript, but it only works on the first <li class="comment"> of the comment area. I want it to do the same for each. Here is the code that only works for the first one.
$(document).ready(function() {  var a = $("li.comment").attr("id");  var b = $("li.comment[id='"+a+"']");  var c = $("li.comment > div.comment-body div > p > a").attr("href");  var d = $("li.comment > div.comment-body div > p > a[href='"+c+"']");  var e = document.createElement("ul");jQuery.each(["#"+a==c], function() {  if("#"+a==c) {	$(e).addClass("children").appendTo(;	d.parents("li.comment").appendTo(e);	$("li ul li div.reply").remove();};});});

Link to comment
Share on other sites

When you get the variable a you're only getting the ID of one element. You should get all comments elements and loop through them.
How do I do that? I'm still new to this.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...