Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter joshlowe

    (@joshlowe)

    Some additional information:
    I CAN post when logged in if I am using the standard template, but not when I use my current template. Here are the form methods of both to compare:

    From Current Template:

    <form action="https://joshlowe.com/wp-comments-post.php" method="post" id="commentform">
    
    	<p>Logged in as <a href="https://joshlowe.com/wp-admin/profile.php">Josh</a>. <a href="https://joshlowe.com/wp-login.php?action=logout" title="Log out of this account">Log out &raquo;</a><input type="hidden" id="author" value="Josh" /><input type="hidden" id="email" value="" /><input type="hidden" id="url" value="" /></p>
    
    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    
     <p><small><strong>Please note:</strong> Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.</small></p>
    
    <p><input name="submit" type="submit" class="button" id="submit-button" tabindex="5" value="Submit Comment" /></p>
    
    </form>

    ——————

    From standard template:

    <form action="https://joshlowe.com/wp-comments-post.php" method="post" id="commentform">
    
    <p>Logged in as <a href="https://joshlowe.com/wp-admin/profile.php">Josh</a>. <a href="https://joshlowe.com/wp-login.php?action=logout" title="Log out of this account">Log out &raquo;</a></p>
    
    <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><a href=&quot;&quot; title=&quot;&quot;> <abbr title=&quot;&quot;> <acronym title=&quot;&quot;> <b> <blockquote cite=&quot;&quot;> <cite> <code> <del datetime=&quot;&quot;> <em> <i> <q cite=&quot;&quot;> <strike> <strong> </code></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="25" />
    </p>
    <input type="hidden" id="_wp_unfiltered_html_comment" name="_wp_unfiltered_html_comment" value="f1ae8c6969" />
    </form>

    ———————

    Main differences between the two that I see:

    Current Template send Author, Email, and Website through hidden forms; Standard Template does not send them at all.

    Standard Template sends a “comment_pst_ID” and “_wp_unfiltered_html_comment” through hidden ids; Current Template does not send them at all.

    Thread Starter joshlowe

    (@joshlowe)

    Resolved. The line submitting the comment_post_ID was inside a loop for non-logged in users. I removed it from there and put it outside of the loop.

    From this:

    <input name="submit" type="submit" class="button" id="submit-button" tabindex="5" size="22" value="Submit Comment" />

    To this:

    <input name="submit" type="submit" class="button" id="submit-button" tabindex="5" size="22" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

    Thank you! I had to use this fix on the “Oriental” theme: https://pure-essence.net/2008/09/19/wordpress-theme-oriental/

    Thanks again!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Able to post comments as guest, unable to post when logged in’ is closed to new replies.