• Resolved scott4more

    (@scott4more)


    This is an error we are getting from our blog site. I’ve been all over the forums, even posted and can’t find the right answer.
    We want readers to be able to comment on our blogs without having to login.
    I deleted a bit of code from the original theme that i thought would solve the problem but now get this error….
    Parse error: syntax error, unexpected T_ENDIF in content/themes/sportsman/comments.php/line 64

    Below is the code for that particular area. Can someone look to see where the error is originating.

    <p>&nbsp;</p>
    <?php if ( comments_open() ) : ?>
    <h3 id="postcomment"><?php _e('Leave a comment'); ?></h3>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
      <p>
        <?php else : ?>
    </p>
    
    <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
    <label for="author"><small>Name <?php if ($req) _e('(required)'); ?></small></label></p>
    
    <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
    <label for="email"><small>Mail (will not be published) <?php if ($req) _e('(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>
    
    <?php endif; ?>
    
    <!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->
    
    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; // If registration required and not logged in ?>
    
    <?php else : // Comments are closed ?>
    <p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter scott4more

    (@scott4more)

    I should add that this is the line it refers to in the error, line 64.

    <?php endif; // If registration required and not logged in ?>

    Any help would be appreciated.

    Thread Starter scott4more

    (@scott4more)

    Managed to locate the missing code. Problem solved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Parse Error’ is closed to new replies.