Support » Themes and Templates » Comment button not working – search button interfering?

  • Resolved Pawel



    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”:

    And here’s how it looks when I type “RSS” into the comment field and hit “Zapisz”:

    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? 🙁

Viewing 8 replies - 1 through 8 (of 8 total)
  • If you look at the code where you got the comments template from:
    You can see that his form have a <form>-tag wrapped around it:
    <form id="commentform" method="post" action="">

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

    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="">


    No, but when i inspect your form all i can see is this:
    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 ?
    That way i can view and try your code.

    Here‘s the link 🙂

    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.

    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?

    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:

    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?


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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Comment button not working – search button interfering?’ is closed to new replies.