• tradesouthwest

    (@tradesouthwestgmailcom)


    After running theme check form my theme admin I found these two errors:

    WARNING: could not find the file comments.php in the theme.
    REQUIRED: Could not find wp_list_comments. See: wp_list_comments
    REQUIRED: Could not find comment_form. See: comment_form

    Is there any way to build a theme without these two calls? I am trying to build a theme with two files, “index and style.” so far I had to give in and create a functions.php so that is three files. Now I am really mad because after research, I find you can not build a theme without the above calla. In short, a comments.php is required.

    I can add a(nother) file but it is the whole idea of the fact that WP says ” the only two files you really need are….” So here I sit broken hearted and am hoping someone knows a workaround.

    I tried using wp_list_comments directly into index.php and also tried a comments function in functions.php. Also tried calling a conditional loop with if (comments()) and called wp_list_comments in one condition and comments_template in the other.

    Prove me wrong because WP says you ONLY NEED TWO FILES to create a theme. I am determined to do this but only to see if it is possible. Currently it seems it is not. Therefore WP needs to retract their statement or remove wp_list_comments from the requirements of a theme build.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You don’t technically need a comments.php because WordPress has built-in defaults for the output of wp_list_comments() and comment_form() if that file isn’t found.

    Thread Starter tradesouthwest

    (@tradesouthwestgmailcom)

    The comment_form() works fine without a comments.php but it does not display the comments. wp_list_comments() can not be used (does not display comments) unless it is inside of comments.php file. I tried so many ways to disprove this and several sources say it is so.

    I just do not see why there is a default wp-include/comments-template.php FILE if WP is requiring you to use comments.php in your theme. This kind of makes the core file useless, in a sense, if you are obligated to build your own template file.

    But I digress; the real question is how to display comments without a comments.php file.

    Thread Starter tradesouthwest

    (@tradesouthwestgmailcom)

    The wp_list_comments() purpose is to display all comments (including Trackbacks & Pingbacks) for posts based on a variety of parameters including ones set in the dashboard in Settings -> Discussion panel.
    One functionality which is NOT part of WordPress core is the ability to separate between post comments and Pings… to display Pings separately from Comments. Which can be optimized in comments.php of your theme.

    So it appears that comments.php file is merely a way to modify the usage of the core comments template. So unless you want to separate pings and tracks you should not need a comments.php file. All custom styling can be done with CSS to make any form or comments look nice but that is all useless if you do not have a working comments template. So why require a file that is not needed. (does nothing for a theme if one does not care about pings.)

    Do you call comments_template() at any point in your theme? You need to do so to set up various comment-related things.

    Thread Starter tradesouthwest

    (@tradesouthwestgmailcom)

    @stephencottontail; Yes. Once I put comments_template() in the comments div everything works fine. It is that the Theme will not pass Theme Review without wp_list_comments. If I put any combination of the two statements there are two comment forms and two list of comments… strangely enough the second “set” of comments have no styles attributes, just text on a transparent background.

    I tried faux methods like: if(have_comments()) : comments_template(); else : wp_list_comments(); and believe it or not the Theme Check passes, but I get funny results when there are no comments or blog page.

    Then I tried inserting an entire comments template content with the wp_list inside of the index.php page which returned one comment with no text and just a user name of “Anonymous.”

    Just for reference: using wp_list_comments all by itself in a file other than comments.php will return blank results, (no comments).

    Quite honestly I submitted the Theme with a comments template and included a note in readme stating the project was not as successful as I hoped.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP List Comments without a comments template’ is closed to new replies.