• Resolved devpaq

    (@devpaq)


    I have a function that calls the latest comments but when I install your plugin it causes a fatal error.
    What would I need to change to my function so that they don’t conflict?

    Here is my function which gets called in the sidebar

    function bg_recent_comments($no_comments = 5, $comment_len = 80, $avatar_size = 48) {
    	$comments_query = new WP_Comment_Query();
    	$comments = $comments_query->query( array( 'number' => $no_comments ) );
    	$comm = '';
    	if ( $comments ) : foreach ( $comments as $comment ) :
    		$comm .= '<div class="individual-comment">Comment by <a class="author" href="' . get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID . '">';
    		$comm .= get_comment_author( $comment->comment_ID ) . ':</a> ';
    		$comm .= '<p>' . strip_tags( substr( apply_filters( 'get_comment_text', $comment->comment_content ), 0, $comment_len ) ) . '...</p></div>';
    	endforeach; else :
    		$comm .= 'No comments.';
    	endif;
    	echo $comm;	
    }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom function conflicts with plugin’ is closed to new replies.