68 posts
  • Has been part of the Envato Community for over 8 years
  • Has sold $1,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
botervet says

Hi,

wordpress issue!!!

Im building this passord protected page. No i want to be able to comment this page. I want to use a custom comment form for this with a textarea field only. cuz i don’t need to know who put the comment there. cuz there is only one person that has acces to this page.

for the other pages i want to use the normal comment.php. so using this isn’t an option!

this is what i’ve tried!

<form method="post" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" id="commentform"> <textarea name="comment" class="cform" id="comment" onfocus="clearText(this)" rows="10" cols="48" tabindex="1" onblur="clearText(this)"></textarea> <input name="submit" id="submit" value="Verstuur Reactie" type="submit" tabindex="2" /> <input name="comment_post_ID" value="<?php echo $id; ?>" type="hidden" /> <?php do_action('comment_form', $post?>ID); ?> </form>

when i use this… no comment is posted and i will go to… http://www.myurl.com/wp-comments-post.php and get a white screen… without getting redirected back to the password protected page.

How can i get this to work?

thanx :)

737 posts
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 more
mordauk says

Try using the default Comment Form (though you could remove the name and email input fields), then go into Settings > Discussion and uncheck “Comment author must fill out name and e-mail ”.

409 posts
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in India
Dhruv says

Don’t forget to Validate the default comment form. (don’t leave it for WordPress to validate)

68 posts
  • Has been part of the Envato Community for over 8 years
  • Has sold $1,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
botervet says

Try using the default Comment Form (though you could remove the name and email input fields), then go into Settings > Discussion and uncheck “Comment author must fill out name and e-mail ”.

Thanx for the reply… but the thing is… For other pages a email and name is required! Or is there a work around?

737 posts
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 more
mordauk says

You could make name and email non required, and then add some custom validation code to your form inputs when not on the password protected page.

68 posts
  • Has been part of the Envato Community for over 8 years
  • Has sold $1,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
botervet says

You could make name and email non required, and then add some custom validation code to your form inputs when not on the password protected page.

can u by any chance give me a startup how to do this? :)

737 posts
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 more
mordauk says

This isn’t a great solution because it wouldn’t check whether the email is valid, but you could do a really simply solution where you just check whether the name and email fields are empty.

Use this as a reference: http://stackoverflow.com/questions/1342676/to-disable-a-send-button-if-fields-empty-by-jquery

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by