Title: get_approved_comments error
Last modified: August 18, 2016

---

# get_approved_comments error

 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/get_approved_comments-error/)
 * Hello all – I’m back from a small hiatus, and I have a question on behalf of 
   a couple of members that are using my Orange Crush theme.
 * I’ve only gotten this problem from two people using the theme – according to 
   the wordpress themes site, there’s been over 1200 people downloading the theme,
   and only two have reported this problem, so I’m guessing the problem does not
   lie with the theme. I know that I have tried to replcate this issue myself, and
   can’t, no matter what I do. I also can’t seem to get the two people who are asking
   me about this to send me more information on it either…so I’m stuck.
 * Anyway, the problem is this: when you click on their comments link (to open the
   popup comments), the window opens with an error:
 * Fatal error: Call to undefined function: get_approved_comments() in URL/wp-content/
   themes/orange-crush-5242006/comments-popup.php on line 44
 * Now, I have looked in my files, and “line 44” is this:
 * $comments = get_approved_comments($id);
 * Now, I copied this part of the comments-popup.php file directly from the default
   theme (Kubrick). Now, the only thing I can think of that *may* be causing this
   error is the fact that my lines are broken up, and not all in one line. However,
   as I said, I copied it *directly* from the Kubrick theme (I copied from the theme
   editor, so the lines were broken up for me – but when I open the Kubrick file
   in Notepad, it’s all one line), and when I use the Orange Crush theme, I do not
   get this error at all – I can’t replciate this error no matter what I do.
 * So I’m wondering what could be causing this error? I find it very hard to believe
   it’s anything in my theme, but if it is, I’d be more than happy to stand corrected
   and fix it (it’s just hard for me to believe, since I got this stuff right from
   the default theme!), but I don’t know how to if it is my fault.
 * Anyway, if someone could help me out on this, I’d appreciate it. (I’d provide
   a link, but it’s not my site, and I’m not sure how the site owner would feel 
   about that!)

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

 *  Thread Starter [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/get_approved_comments-error/#post-429343)
 * Sorry for the bump – it’s been 6 days, though – so I was hoping to get something
   on this?
 *  [blocko](https://wordpress.org/support/users/blocko/)
 * (@blocko)
 * [19 years, 6 months ago](https://wordpress.org/support/topic/get_approved_comments-error/#post-429445)
 * Well, I can’t help, but I can say that I have the same problem with a different
   theme.
 * Here’s what happens when I click the “comments”…
 * `Fatal error: Call to undefined function: get_approved_comments() in /usr/share/
   wordpress/wp-content/themes/nishita/comments-popup.php on line 38`
 * I am running Ubuntu Linux. WordPress was installed by package manager. The relevant
   code reads:
 * `$comments = get_approved_comments($id);`
 * I am using WordPress 1.5.2
 * I echo doodlebee’s sentiment – please help…
 *  [blocko](https://wordpress.org/support/users/blocko/)
 * (@blocko)
 * [19 years, 6 months ago](https://wordpress.org/support/topic/get_approved_comments-error/#post-429446)
 * OK, I tried the default theme, and comments worked.
 * I checked the code for popup comments in the default theme, and it was different!
 * Instead of:
    `$comments = get_approved_comments($id);`
 * There was:
    `$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE
   comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");`
 * So I cut and paste and ended up with:
    `//$comments = get_approved_comments($
   id); $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID
   = $id AND comment_approved = '1' ORDER BY comment_date");
 * And guess what. It works!
 * My only thought is that this could be related to the WordPress version. Note 
   that I couldn’t install the lastest version via package in Ubuntu – because the
   latest version wasn’t in a package.
 * I wonder if this explains your member’s problems, Doodlebee.
 *  Thread Starter [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/get_approved_comments-error/#post-429449)
 * Thanks blocko! (sorry it took so long for me to respond – I just found this!)
   I’ll give it a try and see if it works 🙂

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

The topic ‘get_approved_comments error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * Last activity: [19 years, 4 months ago](https://wordpress.org/support/topic/get_approved_comments-error/#post-429449)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
