Title: Comments on Custom Pages
Last modified: August 18, 2016

---

# Comments on Custom Pages

 *  Resolved [Glitch](https://wordpress.org/support/users/glitch/)
 * (@glitch)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/)
 * Hi,
 * I recently installed WordPress and it’s all working great except for this one
   problem: While comments work fine on blog posts on custom pages it comes up with
   an error:
 * `Warning: comments_template(/www/usersites/m-r/max/pub/wp-content/themes/black):
   failed to open stream: Success in /www/usersites/m-r/max/pub/wp-includes/comment-
   functions.php on line 26`
 * `Fatal error: comments_template(): Failed opening required '/www/usersites/m-
   r/max/pub/wp-content/themes/black' (include_path='.:') in /www/usersites/m-r/
   max/pub/wp-includes/comment-functions.php on line 26`
 * Does anyone know what the issue is here? I can edit PHP if I have decent instructions,
   but I just can’t figure out the issue here.
 * Example link: [http://max.uttx.net/files/](http://max.uttx.net/files/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/#post-347433)
 * Look at your template to see if you’re calling the comments template like so:
 * `<?php comments_template(''); ?>`
 * and change it to:
 * `<?php comments_template(); ?>`
 * (Note the lack of quotes/parameter).
 *  Thread Starter [Glitch](https://wordpress.org/support/users/glitch/)
 * (@glitch)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/#post-347438)
 * I can find any instances of a comments_template function in my theme files, is
   there some sort of compatability issue here, I believe I’m using WordPress 2.0,
   so is there a different syntax for comments or something?
 * Also, is the comments_template fucntion supposed to be in my template files or
   in the comment-functions.php file?
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/#post-347445)
 * The function comments_template() is what we call an [include tag](http://codex.wordpress.org/Include_Tags),
   and belongs in your theme templates (that is, where you want to include/display
   comments).
 * You have to be using it (or some reasonable PHP facsimile) to be including the
   comments template in your posts and Pages. Let’s start with an easy q to help
   track this down: is your theme using a page.php template?
 *  Thread Starter [Glitch](https://wordpress.org/support/users/glitch/)
 * (@glitch)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/#post-347476)
 * No I do not believe so.
 * Here are the template PHP files:
 * index.php
    header.php footer.php comments.php comments-popup.php sidebar.php
 * Does this mean my theme has limited support for custom pages? Does anyone else
   have the Back-In-Black theme running custom pages successfully?
 * **EDIT**
    I have dupliacted my theme index.php and comment.php files for you 
   to look at if you need to:
 * [http://max.uttx.net/wp-content/themes/black/index.php.txt](http://max.uttx.net/wp-content/themes/black/index.php.txt)
   
   [http://max.uttx.net/wp-content/themes/black/comments.php.txt](http://max.uttx.net/wp-content/themes/black/comments.php.txt)
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/#post-347582)
 * “_Does this mean my theme has limited support for custom pages?_“
 * No, it just means any customization has to be done in the templates as is, or
   what templates you need added to that theme.
 * Anyway, this is your problem (in index.php):
 * `<?php comments_template( is_single() ); // Get wp-comments.php template ?>`
 * comments_template() normally accepts only a file (i.e. a template) name as an
   argument; is_single() is what we call a [conditional function or tag](http://codex.wordpress.org/Conditional_Tags),
   and is used for testing what page (or query) type one is viewing. What it should
   look like is this:
 * `<?php if(is_single()) { // if single post
    comments_template(); // Get comments.
   php template  } ?>
 * To also display on Pages, use this:
 * `<?php if(is_single() || is_page()) { // if post/Page
    comments_template(); //
   Get comments.php template  } ?>
 * You can also try just:
 * `<?php comments_template(); // Get comments.php template ?>`
 * since comments_template() should only be included by WordPress on single posts
   and Pages anyway.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/#post-347584)
 * It seems that theme is using a pre-1.5 code for calling the comments template;
   themes were introduced since WP 1.5.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Comments on Custom Pages’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [20 years, 2 months ago](https://wordpress.org/support/topic/comments-on-custom-pages/#post-347584)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
