diff --git a/js/load-comments.js b/js/load-comments.js index b4b321e..db70272 100644 --- a/js/load-comments.js +++ b/js/load-comments.js @@ -9,9 +9,13 @@ $( document ).ready( function() { var commentsURL = wpdc.commentsURL, - $commentArea = $( '#wpdc-comments' ), + $commentArea = $( '#wpdc-comments' ), postId = $commentArea.data( 'post-id' ); + if (!postId) { + return; + } + $.ajax( { url: commentsURL + '?post_id=' + postId,