WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Comment button not working - search button interfering? (9 posts)

  1. pafell
    Member
    Posted 2 years ago #

    Hello!

    I have created a WordPress theme on my own. It is almost finished (just adding some finishing touches) but I have a problem with commenting system. I have used a comments file template I've found on this site.

    The problem I am experiencing is that when I click "Submit comment" (my blog is in Polish so buttons and links are labelled differentely), I am taken to a search results page. I guess there's no right way to explain it so you can try it yourself.

    Here's a link to one of my posts. When you try to comment (feel free to try it; it doesn't matter whether you provide any e-mail address or nickname), it redirects you to a search results page where you see that there were no results for your search (in Polish).

    Perhaps the URL can give you some hint what's going on. Here's how the URL looks like when I search for "RSS":

    http://pafell.pl/?s=RSS

    And here's how it looks when I type "RSS" into the comment field and hit "Zapisz":

    http://pafell.pl/?s=wyszukiwarka%3A+Enter&comment=RSS&submit=Zapisz&comment_post_ID=1&_wp_unfiltered_html_comment=8c77b09649&akismet_comment_nonce=344f95d656

    As you can see the first part of the URL contains search syntax (the default value of search field is "wyszukiwarka: Enter").

    I am also including my template files for comments.php, searchform.php and search.php.

    (as you can see on searchform.php, I have "commented" (disabled) search button. I just wanted visitors to use only Enter key to search, not to display any search button)

    Could you tell me what's wrong with my comment button? :(

  2. bjornhall
    Member
    Posted 2 years ago #

    If you look at the code where you got the comments template from:
    http://www.wpdesigner.com/2007/03/17/wp-theme-lesson-16-comments-template/
    You can see that his form have a <form>-tag wrapped around it:
    <form id="commentform" method="post" action="http://www.wpdesigner.com/wp-comments-post.php">

    You need to add this to your form. (note: must change the action. Can not use wpdesigner.com)

  3. pafell
    Member
    Posted 2 years ago #

    Thanks for your reply! :)

    I think I have that, although in a different way.

    In my comments.php (line 144) I have:

    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

    Should I change that and hard-code it to:

    <form id="commentform" method="post" action="http://pafell.pl/wp-comments-post.php">

    ?

  4. bjornhall
    Member
    Posted 2 years ago #

    No, but when i inspect your form all i can see is this:
    http://i.imgur.com/WGukq.png
    hmm, but when i view the source (not firebug) i can see the form-tag.
    Something is fishy. Could you upload the comments.php to http://pastebin.com/ ?
    That way i can view and try your code.

  5. pafell
    Member
    Posted 2 years ago #

    Here's the link :-)

  6. bjornhall
    Member
    Posted 2 years ago #

    I've tested your code. And it works out fine.
    I THINK that that its your searchbox that could screw it up. Try to comment away the searchbox, and then see if the commenting works.

  7. pafell
    Member
    Posted 2 years ago #

    Tried uncommenting and removing the search box button code. Still same effect :(

    Perhaps I could use other comments template? Where I could get it from?

  8. pafell
    Member
    Posted 2 years ago #

    I have also tried completely removing
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>

    If I try to comment then, all I can see is a blank page with URL:
    http://pafell.pl/wp-comments-post.php

    I really have no idea what else could I try. That's not the first time I've created a WP theme but that's the first time I got such a problem. Perhaps I have omitted something basic while developing the theme?

  9. pafell
    Member
    Posted 2 years ago #

    Resolved!

    I have completely redesigned both my searchform.php and comments.php templates. I still have no idea what went wrong but it works now ;)

Topic Closed

This topic has been closed to new replies.

About this Topic