• Hi,

    I installed a new theme and I just noticed that the comment form doesn’t have a field for commenters to add their URL. Does anyone know how I can add that field?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter RenFromPenn

    (@renfrompenn)

    That doesn’t really tell me how to put the email and URL fields in when they have been left out.

    You can copy and paste that part from the Default theme comments.php

    <p><input 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 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 type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><small>Website</small></label></p>
    Thread Starter RenFromPenn

    (@renfrompenn)

    Okay, here is a copy of the comments.php file that came with the theme. I see no reason why email and URL shouldn’t be showing on the comments box. Could someone please look at this and see if I am missing something?

    <?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>This post is password protected. Enter the password to view comments.</p>
    
    			<?php
    			return;
    		}
    	}
    
    	/* This variable is for alternating comment background */
    	$oddcomment = ' alt';
    ?>
    
    <!-- You can start editing here. -->
    
    <div id="comments" class="comments-list">
    <?php if ($comments) : ?>
    <h2><?php comments_number('No Responses', '1 Response', '% Responses' ); ?> to <?php the_title(); ?></h2>
    
    <?php foreach ($comments as $comment) : ?>
     <div class="entry <?php echo $oddcomment; ?>" id="comment-<?php comment_ID(); ?>">
    <!-- <p class="avt"><img src="<?php gravatar("R", 45, get_bloginfo('template_url')."/images/avatar-replace.png"); ?>" alt="Avatar" /></p> -->
    
     <p class="name"><?php comment_author_link(); ?></p>
     <p class="date"><a href="#comment-<?php comment_ID() ?>"><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a>  <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></p>
    <?php if ($comment->comment_approved == '0') : ?>
     <p><em style=" font-style: normal; color:#FF0000;">Your comment is awaiting moderation.</em></p>
     <?php endif; ?>
     <div class="con"><?php comment_text() ?></div>
    </div>
    
    <?php
    /* Changes every other comment to a different class */
    $oddcomment = ( empty( $oddcomment ) ) ? ' alt ' : '';
    ?>
    <?php endforeach; ?>
    
    <?php elseif ('open' != $post->comment_status) : ?>
    <p class="note">Comments are closed.</p>
    <?php endif; ?>
    </div>
    
    <?php if ('open' == $post->comment_status) : ?>
    <div class="comments-form">
    <h3 id="respond">Comment Form</h3>
    <form id="comment-form" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">
    <?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 : ?>
    
    <?php if ( $user_ID ) : ?>
    <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a></p>
    <?php else : ?>
    <p><input id="comment-name" value="<?php echo $comment_author; ?>" name="author"  type="text" class="formid" /> <label for="comment-name">Your Name <strong class="required"><?php if ($req) echo "(required)"; ?></strong></label></p>
    <p><input id="comment-email" name="email" value="<?php echo $comment_author_email; ?>" type="text" class="formemail" /> <label for="comment-name">Your Email <strong class="required"><?php if ($req) echo "(required)"; ?></strong></label></p>
    <p><input id="comment-url" name="url" value="<?php echo $comment_author_url; ?>" type="text" class="formuri"/> <label for="comment-name">Your URL</label></p>
    <?php endif; ?>
    <p><textarea name="comment" cols="50" rows="8"></textarea></p>
    <p><input name="submit" type="submit" id="submit" tabindex="5" class="button" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    <?php endif; ?>
    </form>
    </div>
    <?php endif; ?>
    Thread Starter RenFromPenn

    (@renfrompenn)

    I just looked at the demo for the theme that I am using and those fields appear at their site. Any idea why they would appear there, but not on my installation? Is there a setting in WordPress 2.7 that disables those boxes?

    Thread Starter RenFromPenn

    (@renfrompenn)

    Okay, I just figured it out. I had my site set that registration is required to comment. I didn’t know that that would then require commenters to have to add their URL in their profile rather than when they post the comment itself. It’s all working fine now that I know that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Impossible to add URL in comments’ is closed to new replies.