• Resolved Pawel

    (@pafell)


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

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

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

    https://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? ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • If you look at the code where you got the comments template from:
    https://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="https://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)

    Thread Starter Pawel

    (@pafell)

    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="https://pafell.pl/wp-comments-post.php">

    ?

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

    Thread Starter Pawel

    (@pafell)

    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.

    Thread Starter Pawel

    (@pafell)

    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?

    Thread Starter Pawel

    (@pafell)

    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:
    https://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?

    Thread Starter Pawel

    (@pafell)

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

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