[resolved] functions error in admin (2 posts)

  1. oldbag66
    Posted 5 years ago #

    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:

    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.


  2. jbbrwcky
    Posted 5 years ago #

    Try this...

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

    ... instead of your line 41.

Topic Closed

This topic has been closed to new replies.

About this Topic