diff --git a/files/templates/comments.html b/files/templates/comments.html
index 0104b67459..61a9e67b61 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -526,6 +526,9 @@
{% endif %}
{% if offset %}
+ {% if p %}
+ {% set pid = p.id %}
+ {% endif %}