How do I make RSS feed for posts comments?
-
I have been using WordPress for just few months so I’m not experienced in editing files.
I want to make RSS comments link for every post I make so my readers can easily be updated of new comments for a post.
I know that I need to edit the comment file but I don’t know what to put in and where, so I ask if you can help me to do it.
The comment file for the theme I’m using is this:
<?php // Do not delete these lines if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!'); if (!empty($post->post_password)) { // if there's a password if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie ?> <p class="nocomments"><?php _e("This post is password protected. Enter the password to view comments."); ?> <?php return; } } /* This variable is for alternating comment background */ $oddcomment = "graybox"; ?> <!-- You can start editing here. --> <?php if ($comments) : ?> <h2 id="comments"><?php comments_number('No Responses','One Response','% Responses' );?></h2> <ol class="commentlist"> <?php foreach ($comments as $comment) : ?> <li class="<?=$oddcomment;?>" id="comment-<?php comment_ID() ?>"> <strong><?php comment_author_link() ?></strong> <p class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a><?php edit_comment_link('Edit comment',' ~ ',''); ?> <?php comment_text() ?> </li> <?php /* Changes every other comment to a different class */ if("graybox" == $oddcomment) {$oddcomment="";} else { $oddcomment="graybox"; } ?> <?php endforeach; /* end for each comment */ ?> </ol> <?php else : // this is displayed if there are no comments so far ?> <?php if ('open' == $post-> comment_status) : ?> <!-- If comments are open, but there are no comments. --> <?php else : // comments are closed ?> <!-- If comments are closed. --> (comments are closed). <?php endif; ?> <?php endif; ?> <?php if ('open' == $post-> comment_status) : ?> <h2 id="respond">Leave a Comment</h2> <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" class="styled" /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" /> <label for="author">Name</label> <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" class="styled" /> <label for="email">Mail (will not be published)</label> <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" class="styled" /> <label for="url">Website</label> <!--<strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?> --> <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4" class="styled"></textarea> <?php if ('none' != get_settings("comment_moderation")) { ?> <small><strong>Please note:</strong> Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.</small> <?php } ?> <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> </form> <?php // if you delete this the sky will fall on your head endif; ?>
- The topic ‘How do I make RSS feed for posts comments?’ is closed to new replies.