Simple Wordpress Modification Help

Discussion in 'General Scripting Chat' started by Knoxgates, Oct 23, 2011.

Thread Status:
Not open for further replies.
  1. Knoxgates

    Knoxgates Supreme Member

    Joined:
    Aug 9, 2008
    Messages:
    1,266
    Likes Received:
    919
    Hi,

    I want to remove "Reply" from the comment section on my wordpress blog. Right now whenever a comment is posted on my blog it shows like this
    [​IMG]

    I want to completely remove the reply url from the comment section.

    I m copying comment template code from the theme below
    Code:
    <?php
    // Do not delete these lines
    	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Please do not load this page directly. Thanks!');
    
    	if ( post_password_required() ) { ?>
    		<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
    	<?php
    		return;
    	}
    ?>
    
    <!-- You can start editing here. -->
    
    <div id="commentlist"> 
    <h3 id="comments"><?php comments_number('No Comment', 'One Comment', '% Comments' );?> to ?<?php the_title(); ?>?</h3>
    
    <?php if ( have_comments() ) : ?>
    
    	<ol>
    	<?php wp_list_comments(); ?>
    	</ol>
    
    	<div id="commentnavi">
    		<div class="prev"><?php previous_comments_link('Older Comments') ?></div>
    		<div class="next"><?php next_comments_link('Newer Comments') ?></div>
    	<div class="clr"></div>
    	</div>
     <?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. -->
    		<ol><li class="odd">No Comment yet. Be the first to comment...</li></ol>
    	 <?php else : // comments are closed ?>
    		<!-- If comments are closed. -->
    		<ol><li class="odd">Comments are closed.</li></ol>
    
    	<?php endif; ?>
    <?php endif; ?>
    </div>
    
    <?php if ('open' == $post->comment_status) : ?>
    
    <div id="respond">
    <h3>Leave your comment here:</h3>
    <div class="cancel-comment-reply">
    	<small><?php cancel_comment_reply_link(); ?></small>
    </div>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p>
    
    <?php else : ?>
    
    <p><input class="textfield" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input class="textfield" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input class="textfield" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><small>Website (Optional)</small></label></p>
    
    <?php endif; ?>
    
    <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
    
    <p><textarea class="text_input text_area" name="comment" id="comment" rows="7" tabindex="4" cols="100%"></textarea></p>
    	<div id="submitbox">
    		<a class="feed" href="<?php bloginfo('comments_rss2_url'); ?>">Subscribe to comments feed</a>
    		<div class="submitbutton">
    			<input name="submit" type="submit" id="submit" class="button" tabindex="5" value="Submit Comment" />
    		</div>
    
    		<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    		<div class="fixed"></div>
    	</div>
    
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; // If registration required and not logged in ?>
    </div>
    
    <?php endif; // if you delete this the sky will fall on your head ?>
    
    Anybody please help in editing the code.

    EDIT: THE REASON WHY I WANT TO REMOVE THE "REPLY" FROM THE THEME IS I M USING SOMEOTHER PLUGIN FOR THREADED COMMENTS. MY THEME DOESN'T SUPPORT REPLY TO FUNCTION.
     
    Last edited by a moderator: Oct 23, 2011
  2. Frement

    Frement Registered Member

    Joined:
    Sep 26, 2010
    Messages:
    66
    Likes Received:
    22
    Location:
    46696E6C616E64
    Heres your code you need, but you need to give me the file which has wp_list_comments() function so I can edit that particular button.

    Code:
    <?php
    // Do not delete these lines
    	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Please do not load this page directly. Thanks!');
    
    	if ( post_password_required() ) { ?>
    		<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
    	<?php
    		return;
    	}
    ?>
    
    <!-- You can start editing here. -->
    
    <div id="commentlist"> 
    <h3 id="comments"><?php comments_number('No Comment', 'One Comment', '% Comments' );?> to "<?php the_title(); ?>"</h3>
    
    <?php if ( have_comments() ) : ?>
    
    	<ol>
    	<?php wp_list_comments(); ?>
    	</ol>
    
    	<div id="commentnavi">
    		<div class="prev"><?php previous_comments_link('Older Comments') ?></div>
    		<div class="next"><?php next_comments_link('Newer Comments') ?></div>
    	<div class="clr"></div>
    	</div>
     <?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. -->
    		<ol><li class="odd">No Comment yet. Be the first to comment...</li></ol>
    	 <?php else : // comments are closed ?>
    		<!-- If comments are closed. -->
    		<ol><li class="odd">Comments are closed.</li></ol>
    
    	<?php endif; ?>
    <?php endif; ?>
    </div>
    
    <?php if ('open' == $post->comment_status) : ?>
    
    <div id="respond">
    <h3>Leave your comment here:</h3>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p>
    
    <?php else : ?>
    
    <p><input class="textfield" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input class="textfield" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input class="textfield" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><small>Website (Optional)</small></label></p>
    
    <?php endif; ?>
    
    <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
    
    <p><textarea class="text_input text_area" name="comment" id="comment" rows="7" tabindex="4" cols="100%"></textarea></p>
    	<div id="submitbox">
    		<a class="feed" href="<?php bloginfo('comments_rss2_url'); ?>">Subscribe to comments feed</a>
    		<div class="submitbutton">
    			<input name="submit" type="submit" id="submit" class="button" tabindex="5" value="Submit Comment" />
    		</div>
    
    		<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    		<div class="fixed"></div>
    	</div>
    
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; // If registration required and not logged in ?>
    </div>
    
    <?php endif; // if you delete this the sky will fall on your head ?>
     
    • Thanks Thanks x 1
  3. MakeLemonade

    MakeLemonade Junior Member

    Joined:
    Mar 30, 2009
    Messages:
    148
    Likes Received:
    67
    Not sure. Try just removing:

    Code:
    <?php wp_list_comments(); ?>
    This is based on using a comment plugin.
     
    • Thanks Thanks x 1
  4. Knoxgates

    Knoxgates Supreme Member

    Joined:
    Aug 9, 2008
    Messages:
    1,266
    Likes Received:
    919
    Problem fixed. It had nothing to do with Comment file.

    I disabled "threaded (nested) comments" in discussion section.

    Mods Please close this thread.
     
Thread Status:
Not open for further replies.