Calling Wordpress experts

by Denden
10 replies
  • WEB DESIGN
  • |
I have a question for you. If I want to remove the url field from the comment section, is it ok to delete the following in comments-legacy.php??

<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small><?php _e('Website', 'woothemes') ?></small></label></p>
#calling #experts #wordpress
  • Profile picture of the author Istvan Horvath
    You should never ever edit WP core files - only theme files!
    Signature

    {{ DiscussionBoard.errors[6529328].message }}
  • Profile picture of the author seopress
    Denden,
    The file comments-legacy.php is not a core file - in fact it is a theme-specific file and there should be no problem with editing it.

    Make SURE to BACKUP the current file before trying your edit, however! That way if there is ANY mess up, you can easily go back to the original version.

    Regards,
    Dave Seldon
    {{ DiscussionBoard.errors[6529808].message }}
  • Profile picture of the author Istvan Horvath
    Oops, sorry, Dave is right.
    Signature

    {{ DiscussionBoard.errors[6530225].message }}
    • Profile picture of the author Denden
      Well, I tried deleting it but nothing happened. Must've missed something...
      Signature
      {{ DiscussionBoard.errors[6534523].message }}
      • Profile picture of the author seopress
        Originally Posted by Denden View Post

        Well, I tried deleting it but nothing happened. Must've missed something...
        Try also deleting similar (or same) code from comments.php

        Regards,
        Dave Seldon
        {{ DiscussionBoard.errors[6534560].message }}
        • Profile picture of the author Denden
          Well now i've changed the theme as the other one I had was too much bother. Only thing is, I no longer have a 'comments-legacy.php', just 'comments.php' but I don't see anything about 'website'. Any ideas?

          <?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"><?php _e( 'This post is password protected. Enter the password to view comments.', 'woothemes' ); ?></p>

          <?php return; } ?>

          <?php $comments_by_type = &separate_comments( $comments ); ?>

          <!-- You can start editing here. -->
          <div id="comments">

          <div id="commenthead">
          <h2 class="post_comm"><?php _e( 'Discussion', 'woothemes' ); ?></h2>
          </div>

          <?php if ( have_comments() ) { ?>

          <?php if ( ! empty( $comments_by_type['comment'] ) ) { ?>

          <h3><?php comments_number( __( 'No Responses', 'woothemes' ), __( 'One Response', 'woothemes' ), __( '% Responses', 'woothemes' ) ); ?> <?php _e( 'to', 'woothemes' ); ?> “<?php the_title(); ?>”</h3>

          <ol id="commentlist">

          <?php wp_list_comments( 'avatar_size=40&callback=custom_comment&type=comme nt' ); ?>

          </ol>

          <div class="navigation">
          <div class="fl"><?php previous_comments_link(); ?></div>
          <div class="fr"><?php next_comments_link(); ?></div>
          <div class="fix"></div>
          </div><!-- /.navigation -->
          <?php } ?>

          <?php if ( ! empty( $comments_by_type['pings'] ) ) { ?>

          <h3 id="pings"><?php _e( 'Trackbacks/Pingbacks', 'woothemes' ); ?></h3>

          <ol id="pinglist">
          <?php wp_list_comments( 'type=pings&callback=list_pings' ); ?>
          </ol>

          <?php } ?>

          <?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. -->
          <h3 class="mast3"><?php _e( 'No comments yet.', 'woothemes' ); ?></h3>

          <?php } else { // comments are closed ?>
          <!-- If comments are closed. -->
          <h3 class="mast3"><?php _e( 'Comments are closed.', 'woothemes' ); ?></h3>

          <?php } ?>

          <?php } ?>

          </div>
          <?php comment_form(); ?>
          Signature
          {{ DiscussionBoard.errors[6539427].message }}
  • Profile picture of the author seopress
    Ah, yes, the problem is in wp_list_comments

    You can review Function Reference/wp list comments « WordPress Codex with an eye to setting up a custom function.

    There is also an interesting looking article at
    Remove url / website from wordpress comments | ChiaoCheng.com

    But it may be simpler to check out a couple of plugins:
    WordPress › disable-hide-comment-url « WordPress Plugins
    and
    WordPress › Disable Author Url and Comment Links « WordPress Plugins

    Hope this helps!

    Regards,
    Dave Seldon
    {{ DiscussionBoard.errors[6540110].message }}
    • Profile picture of the author Denden
      Looks like I managed to do it!

      I went into author.php and removed the url part in there and it seems to have done the job, nothing broken.

      Thank you so much for your help

      That's one thing sorted, now onto another 'problem'...:rolleyes:
      Signature
      {{ DiscussionBoard.errors[6540197].message }}
  • Profile picture of the author lsargent
    What I ALWAYS do when I'm editing wordpress files and I'm trying to delete something (since I know html way better than php), I'll just have Notepad open, highlight & copy the page code to it, then delete something, see if it rendered the result I was looking for, and if not, paste the original code back in there, and start again.
    {{ DiscussionBoard.errors[6542765].message }}
    • Profile picture of the author Denden
      Originally Posted by Logan Sargent View Post

      What I ALWAYS do when I'm editing wordpress files and I'm trying to delete something (since I know html way better than php), I'll just have Notepad open, highlight & copy the page code to it, then delete something, see if it rendered the result I was looking for, and if not, paste the original code back in there, and start again.
      That's what I did otherwise I could've ended up in big trouble
      Signature
      {{ DiscussionBoard.errors[6546275].message }}

Trending Topics