WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Headers already sent, but can't find error (5 posts)

  1. AJ Troxell
    Member
    Posted 1 year ago #

    I am getting a "headers already sent error" and i know that usually this is a formatting problem (being an extra space), but this time I can't see where the issue could be.

    I am separating out trackbacks and pings from comments.

    Here is the part that is giving me a hard time:

    <?php
    /**
     * Comments
     */
    	function squaredv2_comments($comment, $args, $depth) {
    	$GLOBALS['comment'] = $comment; ?>
    	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
    		<div id="comment-<?php comment_ID(); ?>">
    			<div class="avatar">
    				<?php echo get_avatar($comment,$size='66' ); ?>
    			</div>
    
    			<?php if ($comment->comment_approved == '0') : ?>
    				<em><?php _e('Your comment is awaiting moderation.', 'white') ?></em>
    
    			<?php endif; ?>
    
    			<?php comment_text() ?>
    
    			<div class="comment-meta">
    				<div class="info vcard">
    					<?php printf(__('<cite class="fn">%s</cite>, '), get_comment_author_link()) ?>
    					<?php printf(__('%1$s at %2$s', 'white'), get_comment_date(),get_comment_time()) ?><?php edit_comment_link( __( '(Edit)', 'white' ), ' ' ) ?>
    				</div>
    				<?php if($args['max_depth']!=$depth) { ?>
    				<div class="reply">
    					<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
    				</div>
    			<?php } ?>
    			</div>
    			<div class="clear"></div>
    		</div>
    <?php } ?>
    <?php
    /**
     * trackbacks and pings
     */
    	function squaredv2_pings($comment, $args, $depth) {
    	$GLOBALS['comment'] = $comment; ?>
    		<li id="comment-<?php comment_id(); ?>"><?php comment_author_link(); ?>
    <?php } ?>

    The error tells me that the problem is the opening php tag of the second set of code.

  2. Tara
    Member
    Posted 1 year ago #

  3. AJ Troxell
    Member
    Posted 1 year ago #

    As I stated, I know where the problem usually lies. It is that this time I cannot locate the problem. That is why I am asking someone to take a look at if for me to see if they can see something im not.

  4. AJ Troxell
    Member
    Posted 1 year ago #

    I resolved it on my own. It was, as the error stated, part of my functions file. Removing the comments resolved the issue.

  5. Tara
    Member
    Posted 1 year ago #

    Glad you resolved it :-)

Topic Closed

This topic has been closed to new replies.

About this Topic