Cannot modify header information - headers already sent by

h3tr1k

Registered
Здравейте,хора имам един проблем който не мога да оправя ..
дава ми следната грешка

Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wp-content\themes\TheProfessional\includes\functions\comments.php:1) in C:\xampp\htdocs\wp-includes\pluggable.php on line 934

При регистрацията на потребители и при включване изключване на плъгин ..


Ето и файла comments
PHP:
<?php function mytheme_comment($comment, $args, $depth) {
   $GLOBALS['comment'] = $comment; ?>
   <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
   <div id="comment-<?php comment_ID(); ?>" class="comment-body clearfix">
		<div class="avatar">
			<?php echo get_avatar($comment,$size='57'); ?>
			<span class="overlay"></span>
		</div>
		
		<div class="comment-wrap">
			
			<div class="comment-author vcard">
				<?php printf('<span class="fn">%s</span>', get_comment_author_link()) ?> <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php echo(get_comment_date()) ?></a><?php edit_comment_link(__('(Edit)','Professional'),'  ','') ?></div>
			</div>
			
			<?php if ($comment->comment_approved == '0') : ?>
				<em class="moderation"><?php _e('Your comment is awaiting moderation.','Professional') ?></em>
				<br />
			<?php endif; ?>
			
		    <div class="comment-content"><?php comment_text() ?></div> 
		    <div class="reply-container"><?php comment_reply_link(array_merge( $args, array('reply_text' => __('Отговори','Professional'),'depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div>
		</div>
	</div>
	
<?php } ?>
<?php function list_pings($comment, $args, $depth) {
       $GLOBALS['comment'] = $comment;
?>
	<li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?> - <?php comment_excerpt(); ?> 
<?php } ?>
<?php //modify the comment counts to only reflect the number of comments minus pings
if( phpversion() >= '4.4' ) add_filter('get_comments_number', 'comment_count', 0);

function comment_count( $count ) {
		if ( ! is_admin() ) {
			global $id;
			$get_comments = get_comments('post_id=' . $id);
			$comments_by_type = &separate_comments($get_comments);
			return count($comments_by_type['comment']);	
		} else {
            return $count;
        }
}
?>
 
Ако го инклудваш този файл в друг или само ползваш функцията в др. файл,
Код:
ob_start();
го сложи не в този а другия. И след като се изпълнят хедърите напиши това
PHP:
ob_end_flush();
 
Пълнете си буферите безпричинно.


<off> @Fakeheal се бави с урока за грешките, накрая аз ще го направя </off>
 

Back
Горе