WordPress.org

Support

Support » Installation » [Resolved] functions error in admin

[Resolved] functions error in admin

  • actually 2.8.5.

    Ok ive set up WP locally using MAMP, all works fine, uploaded to server, all works fine except when in admin in either PAGES / POSTS the comments column is throwing up the following error:

    Fatal error: Only variables can be passed by reference in /home/sites/samcartermusic.co.uk/public_html/wp-content/themes/sctemplate/functions.php on line 41

    The function file in my template says this:

    <?php
    add_filter('get_comments_number', 'comment_count', 0);
    function comment_count( $count ) {
    	global $id;
    	$comments_by_type = &separate_comments(get_comments('post_id=' . $id));
    	return count($comments_by_type['comment']);
    }
    ?>

    line 41 is this:
    $comments_by_type = &separate_comments(get_comments('post_id=' . $id));

    Its a bit beyond me this error, any help would be appreciated.

    thanks

Viewing 1 replies (of 1 total)
  • jbbrwcky

    @jbbrwcky

    Try this…

    $get_comments= get_comments('post_id=' . $id);
    $comments_by_type = &separate_comments($get_comments);

    … instead of your line 41.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] functions error in admin’ is closed to new replies.
Skip to toolbar